@pisell/pisellos 3.0.37 → 3.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2467,8 +2467,13 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2467
2467
|
// m.times 需要做个过滤,假设 timeSlice.start_at 是 09:30 timeSlice.end_at 是 11:30
|
|
2468
2468
|
// time 是 time.start_at = 2025-05-26 10:30, time.end_at = 2025-05-26 12:30
|
|
2469
2469
|
// 需要判断 time 的开始结束时间 是否包含timeSlice的开始结束时间
|
|
2470
|
+
|
|
2471
|
+
// n.start_at 是 2025-06-30 15:00 end_at 2025-06-30 17:00
|
|
2472
|
+
// item.start 是 2025-06-30 16:00 item.end 是 2025-06-30 19:00
|
|
2473
|
+
// 需要判断 n.start_at 和 n.end_at 是否在 item.start 和 item.end 之间
|
|
2474
|
+
// 如果 n.start_at 和 n.end_at 在 item.start 和 item.end 有交集,则此时间需要计算
|
|
2470
2475
|
var mTimes = m.times.filter(function (n) {
|
|
2471
|
-
return !dayjs(n.start_at).isAfter(dayjs(item.start), 'minute') && !dayjs(n.end_at).isBefore(dayjs(item.end), 'minute');
|
|
2476
|
+
return !dayjs(n.start_at).isAfter(dayjs(item.start), 'minute') && !dayjs(n.end_at).isBefore(dayjs(item.end), 'minute') || dayjs(n.start_at).isBefore(dayjs(item.end), 'minute') && dayjs(n.end_at).isAfter(dayjs(item.start), 'minute');
|
|
2472
2477
|
});
|
|
2473
2478
|
// 如果在这个区间的时间一个都没有,可以直接认为这个资源不可用
|
|
2474
2479
|
if (mTimes.length === 0) {
|
|
@@ -1702,7 +1702,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1702
1702
|
let currentResourcesCount = 0;
|
|
1703
1703
|
const currentResourcesTimeSlotCanUsedArr = [];
|
|
1704
1704
|
const mTimes = m.times.filter((n) => {
|
|
1705
|
-
return !(0, import_dayjs.default)(n.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n.end_at).isBefore((0, import_dayjs.default)(item.end), "minute");
|
|
1705
|
+
return !(0, import_dayjs.default)(n.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
|
|
1706
1706
|
});
|
|
1707
1707
|
if (mTimes.length === 0) {
|
|
1708
1708
|
return;
|