16 lines
294 B
JavaScript
16 lines
294 B
JavaScript
import { calcSecond } from "@/utils/date";
|
|
|
|
export function getOrderDuration(order) {
|
|
if (order == null) {
|
|
return 0;
|
|
}
|
|
if (order.duration != null) {
|
|
return order.duration;
|
|
}
|
|
if (order.startTime != null) {
|
|
return calcSecond(order.startTime, new Date());
|
|
}
|
|
return 0;
|
|
}
|
|
|