@hi-ui/hiui 3.9.5 → 3.9.6

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.
@@ -77,60 +77,34 @@ var Time = function Time(_ref) {
77
77
  if (PropsType === 'timerange' || PropsType === 'time' || PropsType === 'default' || showTime) {
78
78
  if (timeRangePanelType === 'right') {
79
79
  var _deconstructDate = (0, _utils.deconstructDate)(startDate),
80
+ year = _deconstructDate.year,
81
+ month = _deconstructDate.month,
82
+ sDate = _deconstructDate.date,
80
83
  hour = _deconstructDate.hour,
81
84
  minute = _deconstructDate.minute,
82
85
  second = _deconstructDate.second;
83
86
 
84
87
  var _ref2 = date ? (0, _utils.deconstructDate)(date) : (0, _utils.deconstructDate)(new Date()),
88
+ endYear = _ref2.year,
89
+ endMonth = _ref2.month,
90
+ endDate = _ref2.date,
85
91
  endHour = _ref2.hour,
86
- endMinute = _ref2.minute;
87
-
88
- var dateDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'days');
89
- var hourDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'hour');
90
- var minuteDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'minutes'); // 不在同一天
91
-
92
- if (dateDiff !== 0) {
93
- isDisabled = dateDiff < 0;
94
- } // 在同一天,则比较小时
95
- else {
96
- if (type === 'hour') {
97
- isDisabled = hour > i;
98
- } else {
99
- // 不在同一小时
100
- if (hourDiff !== 0) {
101
- isDisabled = hourDiff < 0;
102
- } // 在同一小时,则比较分钟
103
- else {
104
- if (type === 'minute') {
105
- if (endHour === hour) {
106
- isDisabled = minute > i;
107
- }
108
-
109
- if (endHour < hour) {
110
- isDisabled = true;
111
- }
112
- } else {
113
- // 不在同一分
114
- if (minuteDiff !== 0) {
115
- isDisabled = minuteDiff < 0;
116
- } // 在同一分钟,则比较秒
117
- else {
118
- if (endHour === hour) {
119
- isDisabled = endMinute === minute && second > i;
120
-
121
- if (endMinute < minute) {
122
- isDisabled = true;
123
- }
124
- }
125
-
126
- if (endHour < hour) {
127
- isDisabled = true;
128
- }
129
- }
130
- }
131
- }
132
- }
133
- }
92
+ endMinute = _ref2.minute,
93
+ endSecond = _ref2.second;
94
+
95
+ var start = new Date("".concat(year, "-").concat((0, _utils.convertMonth)(month), "-").concat(sDate, " ").concat(hour, ":").concat(minute, ":").concat(second));
96
+
97
+ if (type === 'hour') {
98
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(i, ":").concat(endMinute, ":").concat(endSecond));
99
+ }
100
+
101
+ if (type === 'minute') {
102
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(endHour, ":").concat(i, ":").concat(endSecond));
103
+ }
104
+
105
+ if (type === 'second') {
106
+ isDisabled = start > new Date("".concat(endYear, "-").concat((0, _utils.convertMonth)(endMonth), "-").concat(endDate, " ").concat(endHour, ":").concat(endMinute, ":").concat(i));
107
+ }
134
108
  }
135
109
 
136
110
  return isDisabled;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.normalizeWeekOffset = exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
8
+ exports.convertMonth = exports.normalizeWeekOffset = exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -354,4 +354,16 @@ var normalizeWeekOffset = function normalizeWeekOffset(date, weekOffset) {
354
354
  return clone;
355
355
  };
356
356
 
357
- exports.normalizeWeekOffset = normalizeWeekOffset;
357
+ exports.normalizeWeekOffset = normalizeWeekOffset;
358
+
359
+ var convertMonth = function convertMonth(month) {
360
+ if (typeof Number(month) !== 'number') {
361
+ return '01';
362
+ }
363
+
364
+ var _month = month + 1;
365
+
366
+ return _month < 10 ? '0' + _month : _month;
367
+ };
368
+
369
+ exports.convertMonth = convertMonth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/hiui",
3
- "version": "3.9.5",
3
+ "version": "3.9.6",
4
4
  "description": "HIUI for React",
5
5
  "scripts": {
6
6
  "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",