@pisell/pisellos 0.0.93 → 0.0.94

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.
@@ -728,9 +728,10 @@ export function getAllSortedDateRanges(schedules) {
728
728
  });
729
729
 
730
730
  // 排序完了,还需要做个去重,如果有开始时间结束时间完全一致的,则只保留一个
731
+ // 需要使用 dayjs 的 isSame 方法来判断
731
732
  var uniqueDateRanges = sortedDateRanges.filter(function (range, index, self) {
732
733
  return index === self.findIndex(function (t) {
733
- return t.start === range.start && t.end === range.end;
734
+ return dayjs(t.start).isSame(dayjs(range.start)) && dayjs(t.end).isSame(dayjs(range.end));
734
735
  });
735
736
  });
736
737
  return uniqueDateRanges;
@@ -582,7 +582,7 @@ function getAllSortedDateRanges(schedules) {
582
582
  return durationA - durationB;
583
583
  });
584
584
  const uniqueDateRanges = sortedDateRanges.filter(
585
- (range, index, self) => index === self.findIndex((t) => t.start === range.start && t.end === range.end)
585
+ (range, index, self) => index === self.findIndex((t) => (0, import_dayjs.default)(t.start).isSame((0, import_dayjs.default)(range.start)) && (0, import_dayjs.default)(t.end).isSame((0, import_dayjs.default)(range.end)))
586
586
  );
587
587
  return uniqueDateRanges;
588
588
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.93",
4
+ "version": "0.0.94",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",