@zgfe/business-lib 1.2.51-ljy.11 → 1.2.51-ljy.13
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.
|
@@ -41,6 +41,8 @@ export default (function () {
|
|
|
41
41
|
key: "".concat(includeToday, "--2"),
|
|
42
42
|
onChange: handleChange,
|
|
43
43
|
includeToday: includeToday,
|
|
44
|
-
defaultValue: time
|
|
44
|
+
defaultValue: time,
|
|
45
|
+
selectRange: 365,
|
|
46
|
+
selectRangeUnit: "days"
|
|
45
47
|
}), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u503C\uFF1A", JSON.stringify(time))));
|
|
46
48
|
});
|
|
@@ -17,6 +17,12 @@ import { isTodayInRange } from './utils';
|
|
|
17
17
|
import _ from 'lodash';
|
|
18
18
|
var RangePicker = DatePicker.RangePicker;
|
|
19
19
|
var BizDateBeyondRange = false;
|
|
20
|
+
var DateSingleMap = {
|
|
21
|
+
day: 1,
|
|
22
|
+
week: 7,
|
|
23
|
+
month: 30,
|
|
24
|
+
quarter: 91
|
|
25
|
+
};
|
|
20
26
|
var BizDate = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
27
|
var selectRange = _ref.selectRange,
|
|
22
28
|
selectRangeUnit = _ref.selectRangeUnit,
|
|
@@ -135,7 +141,7 @@ var BizDate = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
135
141
|
if (includeToday && value && value.length === 2 && isTodayInRange(value[0], value[1])) {
|
|
136
142
|
subtractDays = 1;
|
|
137
143
|
}
|
|
138
|
-
if (value && value.length === 2 && moment(_.cloneDeep(value[1]).subtract(subtractDays, 'days').format('YYYY-MM-DD')).diff(moment(value[0].format('YYYY-MM-DD')), selectRangeUnit || 'months') >= (selectRange ? selectRange : 12)) {
|
|
144
|
+
if (value && value.length === 2 && moment(_.cloneDeep(value[1]).subtract(subtractDays, 'days').format('YYYY-MM-DD')).diff(moment(value[0].format('YYYY-MM-DD')), selectRangeUnit || 'months') >= (selectRange ? Math.floor(selectRange / Reflect.get(DateSingleMap, currentType)) : 12)) {
|
|
139
145
|
BizDateBeyondRange = true;
|
|
140
146
|
return;
|
|
141
147
|
}
|
|
@@ -8,7 +8,6 @@ import { BizDatePickerOld } from '@zgfe/business-lib';
|
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
|
|
10
10
|
import { Divider, Space, Switch } from 'antd';
|
|
11
|
-
import { DatePickerTypes } from '../types';
|
|
12
11
|
export default (function () {
|
|
13
12
|
var _useState = useState({
|
|
14
13
|
begin: '2024-05-01',
|
|
@@ -34,7 +33,6 @@ export default (function () {
|
|
|
34
33
|
})), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(BizDatePickerOld, {
|
|
35
34
|
key: "".concat(includeToday, "--2"),
|
|
36
35
|
value: time,
|
|
37
|
-
dateTypeList: [DatePickerTypes.Unit.day],
|
|
38
36
|
selectRange: 30,
|
|
39
37
|
selectRangeUnit: "days",
|
|
40
38
|
onChange: handleChange
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.51-ljy.
|
|
3
|
+
"version": "1.2.51-ljy.13",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "b784e41c49a818e87fb69460e11b6f90983f7605",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|