@pisell/pisellos 2.0.37 → 2.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.
@@ -2362,7 +2362,11 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2362
2362
  var resourcesEndTime = targetResourceTimes.reduce(function (acc, curr) {
2363
2363
  return dayjs(curr.end_at).isBefore(dayjs(acc.end_at)) ? curr : acc;
2364
2364
  }, targetResourceTimes[0]);
2365
- var endTime = dayjs(resourcesEndTime.end_at).isBefore(dayjs(operating_day_boundary)) ? resourcesEndTime.end_at : operating_day_boundary;
2365
+
2366
+ // 将 operating_day_boundary 转换为与 resourcesEndTime.end_at 相同日期的完整日期时间
2367
+ var resourceDate = dayjs(resourcesEndTime.end_at).format('YYYY-MM-DD');
2368
+ var operatingBoundaryDateTime = "".concat(resourceDate, " ").concat(operating_day_boundary);
2369
+ var endTime = dayjs(resourcesEndTime.end_at).isBefore(dayjs(operatingBoundaryDateTime)) ? resourcesEndTime.end_at : operatingBoundaryDateTime;
2366
2370
  // 修复:如果 endTime 只是时间格式(如 "17:00"),需要加上日期
2367
2371
  var formattedEndTime;
2368
2372
  if (typeof endTime === 'string' && endTime.includes(':') && !endTime.includes(' ') && !endTime.includes('T')) {
@@ -1618,7 +1618,9 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1618
1618
  const resourcesEndTime = targetResourceTimes.reduce((acc, curr) => {
1619
1619
  return (0, import_dayjs.default)(curr.end_at).isBefore((0, import_dayjs.default)(acc.end_at)) ? curr : acc;
1620
1620
  }, targetResourceTimes[0]);
1621
- const endTime = (0, import_dayjs.default)(resourcesEndTime.end_at).isBefore((0, import_dayjs.default)(operating_day_boundary)) ? resourcesEndTime.end_at : operating_day_boundary;
1621
+ const resourceDate = (0, import_dayjs.default)(resourcesEndTime.end_at).format("YYYY-MM-DD");
1622
+ const operatingBoundaryDateTime = `${resourceDate} ${operating_day_boundary}`;
1623
+ const endTime = (0, import_dayjs.default)(resourcesEndTime.end_at).isBefore((0, import_dayjs.default)(operatingBoundaryDateTime)) ? resourcesEndTime.end_at : operatingBoundaryDateTime;
1622
1624
  let formattedEndTime;
1623
1625
  if (typeof endTime === "string" && endTime.includes(":") && !endTime.includes(" ") && !endTime.includes("T")) {
1624
1626
  const currentDate = timeSlots.start_at.format("YYYY-MM-DD");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.0.37",
4
+ "version": "2.0.38",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",