intelicoreact 0.2.59 → 0.2.60
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.
|
@@ -98,8 +98,8 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
98
98
|
var _inputRef$current;
|
|
99
99
|
|
|
100
100
|
var value = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
|
|
101
|
-
|
|
102
|
-
if (
|
|
101
|
+
if ((0, _momentTimezone.default)(value, format).format(format) === 'Invalid date' || value.indexOf('_') > -1) value = '';
|
|
102
|
+
if (value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).startOf('day').isBefore(momentMinDate, 'days')) onChange(formattedMinDate);else if (value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).endOf('day').isAfter(momentMaxDate, 'days')) onChange(formattedMaxDate);else if (value) onChange((0, _momentTimezone.default)(value, format).format(format));
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
var onKeyDown = function onKeyDown(e) {
|
|
@@ -119,7 +119,13 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
119
119
|
setOpenedByEnter(true);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
if (isValidLenght)
|
|
122
|
+
if (isValidLenght) {
|
|
123
|
+
setIsOpened(false);
|
|
124
|
+
handleBlur();
|
|
125
|
+
} else {
|
|
126
|
+
setIsOpened(true);
|
|
127
|
+
}
|
|
128
|
+
|
|
123
129
|
onKeyUpProp(e);
|
|
124
130
|
};
|
|
125
131
|
|