123456789101112131415161718192021222324 |
- function calcDeliveryTimeRang() {
- let interval = 20;
- let start = dayjs(this.nowTime);
- let takeUpTime = Number(this.sale.billServiceTime);
- let min = dayjs(start).add(takeUpTime, "minute");
- let max = dayjs(start).add(24, "hour");
- let current = min;
- let array = [];
- do {
- current = current.add(interval, "minute");
- array.push({
- label: current.format("HH:mm"),
- value: current.format("YYYY-MM-DD HH:mm"),
- });
- } while (current.add(interval, "minute").isBefore(dayjs(max)));
- array.push({
- label: current.format("HH:mm"),
- value: current.format("YYYY-MM-DD HH:mm"),
- });
- return array;
- }
|