resolver-egretimp-plus 0.1.60 → 0.1.61
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
|
@@ -11,6 +11,7 @@ import { useAttrs, computed, watch, nextTick, useSlots } from 'vue'
|
|
|
11
11
|
import { commonPropsType, formatDate, isDate, hasOwn } from '../../utils/index.js'
|
|
12
12
|
import { useFormItem } from 'element-plus'
|
|
13
13
|
import dateIcon from '../icons/date.vue'
|
|
14
|
+
import dayjs from 'dayjs'
|
|
14
15
|
|
|
15
16
|
const slots = useSlots()
|
|
16
17
|
const { formItem: elFormItem } = useFormItem()
|
|
@@ -70,21 +71,17 @@ watch(value, () => {
|
|
|
70
71
|
})
|
|
71
72
|
|
|
72
73
|
const disabledDate = (date) => {
|
|
73
|
-
|
|
74
|
-
const
|
|
74
|
+
const currentDateStr = dayjs(date).format('YYYY-MM-DD')
|
|
75
|
+
const currentDateUnix = dayjs(currentDateStr).unix()
|
|
75
76
|
if (props.min) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
if (typeof props.min === 'string' && new Date(props.min).getTime() > newDate.getTime()) {
|
|
77
|
+
const minUnix = dayjs(props.min).unix()
|
|
78
|
+
if (minUnix > currentDateUnix) {
|
|
80
79
|
return true
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
if (props.max) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
if (typeof props.max === 'string' && new Date(props.max).getTime() < newDate.getTime()) {
|
|
83
|
+
const maxUnix = dayjs(props.max).unix()
|
|
84
|
+
if (maxUnix < currentDateUnix) {
|
|
88
85
|
return true
|
|
89
86
|
}
|
|
90
87
|
}
|