@pisell/pisellos 0.0.217 → 0.0.218

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.
@@ -431,6 +431,10 @@ export var getTimeSlicesByResource = function getTimeSlicesByResource(_ref5) {
431
431
 
432
432
  // 存储所有时间切片
433
433
  var timeSlices = [];
434
+ // times 先以开始时间为准做个排序,时间早的先循环
435
+ times.sort(function (a, b) {
436
+ return dayjs(a.start_at).diff(dayjs(b.start_at), 'minute');
437
+ });
434
438
 
435
439
  // 处理每个时间范围
436
440
  times.forEach(function (time) {
@@ -345,8 +345,11 @@ var getTimeSlicesByResource = ({
345
345
  operating_day_boundary,
346
346
  maxBlockThreshold
347
347
  }) => {
348
- const { times } = resource;
348
+ let { times } = resource;
349
349
  const timeSlices = [];
350
+ times.sort((a, b) => {
351
+ return (0, import_dayjs.default)(a.start_at).diff((0, import_dayjs.default)(b.start_at), "minute");
352
+ });
350
353
  times.forEach((time) => {
351
354
  const startTime = (0, import_dayjs.default)(`${time.start_at}`);
352
355
  const endTime = (0, import_dayjs.default)(`${time.end_at}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.217",
4
+ "version": "0.0.218",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",