@pisell/pisellos 0.0.217 → 0.0.219

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.
@@ -1,5 +1,5 @@
1
1
  export declare const SORT_BY = "id";
2
- export declare const DEFAULT_PAGE_SIZE = 5;
2
+ export declare const DEFAULT_PAGE_SIZE = 20;
3
3
  export declare const DEFAULT_CUSTOMER: {
4
4
  id: number;
5
5
  nickname: string;
@@ -2,7 +2,7 @@
2
2
  export var SORT_BY = "id";
3
3
 
4
4
  // 默认每页数量
5
- export var DEFAULT_PAGE_SIZE = 5;
5
+ export var DEFAULT_PAGE_SIZE = 20;
6
6
 
7
7
  // 默认客户
8
8
  export var DEFAULT_CUSTOMER = {
@@ -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) {
@@ -1,5 +1,5 @@
1
1
  export declare const SORT_BY = "id";
2
- export declare const DEFAULT_PAGE_SIZE = 5;
2
+ export declare const DEFAULT_PAGE_SIZE = 20;
3
3
  export declare const DEFAULT_CUSTOMER: {
4
4
  id: number;
5
5
  nickname: string;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(constants_exports);
27
27
  var SORT_BY = "id";
28
- var DEFAULT_PAGE_SIZE = 5;
28
+ var DEFAULT_PAGE_SIZE = 20;
29
29
  var DEFAULT_CUSTOMER = {
30
30
  "id": 1,
31
31
  "nickname": "Select a customer",
@@ -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.219",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",