assui 3.0.6 → 3.0.9
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,6 +1,5 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import formatMessage from '../messages';
|
|
3
|
-
var now = moment();
|
|
4
3
|
export var dateTypeEnum;
|
|
5
4
|
(function (dateTypeEnum) {
|
|
6
5
|
dateTypeEnum[dateTypeEnum["TODAY"] = 1] = "TODAY";
|
|
@@ -19,6 +18,7 @@ export var dateTypeEnum;
|
|
|
19
18
|
dateTypeEnum[dateTypeEnum["BEFORE_365_DAY"] = 14] = "BEFORE_365_DAY";
|
|
20
19
|
})(dateTypeEnum || (dateTypeEnum = {}));
|
|
21
20
|
var getDefaultRadioList = function getDefaultRadioList(message) {
|
|
21
|
+
var now = moment();
|
|
22
22
|
var defaultRadioList = [{
|
|
23
23
|
key: dateTypeEnum.TODAY,
|
|
24
24
|
text: formatMessage(message, 'labelCustomizeRangePicker', 'toDay'),
|
|
@@ -147,15 +147,15 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
147
147
|
var isChangeStartData = !(startDate === null || startDate === void 0 ? void 0 : startDate.clone().isSame(nextStartDate, 'day'));
|
|
148
148
|
if (isChangeStartData) {
|
|
149
149
|
if (nextEndDate.diff(nextStartDate, 'day') > maxScope) {
|
|
150
|
-
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day');
|
|
150
|
+
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day').endOf('day');
|
|
151
151
|
}
|
|
152
152
|
} else if (nextEndDate.diff(nextStartDate, 'day') > maxScope) {
|
|
153
|
-
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day');
|
|
153
|
+
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day').startOf('day');
|
|
154
154
|
}
|
|
155
155
|
} else if (!nextStartDate && nextEndDate) {
|
|
156
|
-
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day');
|
|
156
|
+
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day').startOf('day');
|
|
157
157
|
} else if (nextStartDate && !nextEndDate) {
|
|
158
|
-
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day');
|
|
158
|
+
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day').endOf('day');
|
|
159
159
|
}
|
|
160
160
|
if (nextStartDate && nextEndDate) {
|
|
161
161
|
return setDate([nextStartDate, nextEndDate]);
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11
11
|
exports.dateTypeEnum = void 0;
|
|
12
12
|
var moment_1 = __importDefault(require("moment"));
|
|
13
13
|
var messages_1 = __importDefault(require("../messages"));
|
|
14
|
-
var now = (0, moment_1["default"])();
|
|
15
14
|
var dateTypeEnum;
|
|
16
15
|
(function (dateTypeEnum) {
|
|
17
16
|
dateTypeEnum[dateTypeEnum["TODAY"] = 1] = "TODAY";
|
|
@@ -30,6 +29,7 @@ var dateTypeEnum;
|
|
|
30
29
|
dateTypeEnum[dateTypeEnum["BEFORE_365_DAY"] = 14] = "BEFORE_365_DAY";
|
|
31
30
|
})(dateTypeEnum = exports.dateTypeEnum || (exports.dateTypeEnum = {}));
|
|
32
31
|
var getDefaultRadioList = function getDefaultRadioList(message) {
|
|
32
|
+
var now = (0, moment_1["default"])();
|
|
33
33
|
var defaultRadioList = [{
|
|
34
34
|
key: dateTypeEnum.TODAY,
|
|
35
35
|
text: (0, messages_1["default"])(message, 'labelCustomizeRangePicker', 'toDay'),
|
|
@@ -190,15 +190,15 @@ var LabelCustomizeRangePicker = function LabelCustomizeRangePicker(props) {
|
|
|
190
190
|
var isChangeStartData = !(startDate === null || startDate === void 0 ? void 0 : startDate.clone().isSame(nextStartDate, 'day'));
|
|
191
191
|
if (isChangeStartData) {
|
|
192
192
|
if (nextEndDate.diff(nextStartDate, 'day') > maxScope) {
|
|
193
|
-
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day');
|
|
193
|
+
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day').endOf('day');
|
|
194
194
|
}
|
|
195
195
|
} else if (nextEndDate.diff(nextStartDate, 'day') > maxScope) {
|
|
196
|
-
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day');
|
|
196
|
+
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day').startOf('day');
|
|
197
197
|
}
|
|
198
198
|
} else if (!nextStartDate && nextEndDate) {
|
|
199
|
-
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day');
|
|
199
|
+
nextStartDate = nextEndDate.clone().subtract(maxScope - 1, 'day').startOf('day');
|
|
200
200
|
} else if (nextStartDate && !nextEndDate) {
|
|
201
|
-
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day');
|
|
201
|
+
nextEndDate = nextStartDate.clone().add(maxScope - 1, 'day').endOf('day');
|
|
202
202
|
}
|
|
203
203
|
if (nextStartDate && nextEndDate) {
|
|
204
204
|
return setDate([nextStartDate, nextEndDate]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/react-beautiful-dnd": "^13.1.2",
|
|
36
36
|
"@types/react-color": "^3.0.6",
|
|
37
37
|
"@types/react-resizable": "^3.0.0",
|
|
38
|
-
"a-icons": "^1.1.
|
|
38
|
+
"a-icons": "^1.1.2",
|
|
39
39
|
"aa-utils": "^2.1.7",
|
|
40
40
|
"ahooks": "^3.0.8",
|
|
41
41
|
"bignumber.js": "^9.0.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"node": ">=10.0.0"
|
|
81
81
|
},
|
|
82
82
|
"license": "MIT",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "e69921984366d0775f098a0904c7530680b32eff"
|
|
84
84
|
}
|