@gm-mobile/c-service-time 3.9.7-beta.4 → 3.9.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-mobile/c-service-time",
3
- "version": "3.9.7-beta.4",
3
+ "version": "3.9.7",
4
4
  "description": "> TODO: description",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-mobile#readme",
@@ -21,12 +21,12 @@
21
21
  "url": "https://github.com/gmfe/gm-mobile/issues"
22
22
  },
23
23
  "dependencies": {
24
- "@gm-mobile/c-react": "^3.9.7-beta.4",
25
- "@gm-mobile/locales": "^3.9.7-beta.4"
24
+ "@gm-mobile/c-react": "^3.9.7",
25
+ "@gm-mobile/locales": "^3.9.7"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "lodash": "^4.17.15",
29
29
  "moment": "^2.27.0"
30
30
  },
31
- "gitHead": "4424cdf414312317331f3c649cc6e5902257d5fb"
31
+ "gitHead": "0899027d262122bf32d9d1ea09d3474fbd0247c5"
32
32
  }
@@ -2,7 +2,7 @@ import React, { useState, useMemo, FC } from 'react'
2
2
  import { getLocale } from '@gm-mobile/locales'
3
3
  import { CouplingPicker, Flex, Button, View } from '@gm-mobile/c-react'
4
4
  import _ from 'lodash'
5
- import moment from 'moment'
5
+ import moment from 'dayjs'
6
6
 
7
7
  import PickerStatics from './statics'
8
8
  import { getReceiveTimeParams } from './utils'
@@ -3,7 +3,7 @@ import { getLocale } from '@gm-mobile/locales'
3
3
  import { CouplingPicker, Flex, Button, View } from '@gm-mobile/c-react'
4
4
  import _ from 'lodash'
5
5
 
6
- import moment from 'moment'
6
+ import moment from 'dayjs'
7
7
  import PickerStatics from './statics'
8
8
  import {
9
9
  getReceiveTimeParams,
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash'
2
- import moment, { DurationInputArg1, Moment } from 'moment'
3
-
2
+ import moment, { Dayjs } from 'dayjs'
4
3
  // 注意:为了方便,此库的日期都用 moment 格式表示,非 Date
5
4
  // 选开始才选结束
6
5
  //
@@ -60,18 +59,14 @@ function processStartEndValuesWithCycleList(receiveTime: any, cycleList: any) {
60
59
 
61
60
  const start = moment()
62
61
  .add(defaultSpanStartFlag, 'days')
63
- .set({
64
- hours: defaultStart.split(':')[0],
65
- minute: defaultStart.split(':')[1],
66
- })
62
+ .set('hours', defaultStart.split(':')[0])
63
+ .set('minute', defaultStart.split(':')[1])
67
64
  .startOf('minute')
68
65
 
69
66
  const end = moment()
70
67
  .add(defaultSpanEndFlag, 'days')
71
- .set({
72
- hours: defaultEnd.split(':')[0],
73
- minute: defaultEnd.split(':')[1],
74
- })
68
+ .set('hours', defaultEnd.split(':')[0])
69
+ .set('minute', defaultEnd.split(':')[1])
75
70
  .startOf('minute')
76
71
 
77
72
  // 默认
@@ -102,10 +97,8 @@ function getTime(spanTime: DurationInputArg1, timeStr: any, orderTime = null) {
102
97
  const time = orderTime ? moment(orderTime) : moment()
103
98
  return time
104
99
  .add(spanTime, 'days')
105
- .set({
106
- hours: timeStr.split(':')[0],
107
- minute: timeStr.split(':')[1],
108
- })
100
+ .set('hours', timeStr.split(':')[0])
101
+ .set('minute', timeStr.split(':')[1])
109
102
  .startOf('minute')
110
103
  }
111
104
 
@@ -181,7 +174,7 @@ function cycleListToDayList(cycleList: any) {
181
174
  // 打平
182
175
  const list = _.flatten(cycleList)
183
176
 
184
- let dayEnd: Moment | null = null
177
+ let dayEnd: Dayjs | null = null
185
178
  let temp: any[] = []
186
179
  _.each(list, (d: any) => {
187
180
  if (!dayEnd) {