intelicoreact 0.2.58 → 0.2.59
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.
|
@@ -45,6 +45,8 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
45
45
|
mask = _ref$mask === void 0 ? '99/99/9999' : _ref$mask,
|
|
46
46
|
isListTop = _ref.isListTop,
|
|
47
47
|
disabled = _ref.disabled,
|
|
48
|
+
_ref$disabledFormatte = _ref.disabledFormattedMaxDate,
|
|
49
|
+
disabledFormattedMaxDate = _ref$disabledFormatte === void 0 ? false : _ref$disabledFormatte,
|
|
48
50
|
_ref$onKeyDown = _ref.onKeyDown,
|
|
49
51
|
onKeyDownProp = _ref$onKeyDown === void 0 ? function (e) {} : _ref$onKeyDown,
|
|
50
52
|
_ref$onKeyUp = _ref.onKeyUp,
|
|
@@ -96,7 +98,8 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
96
98
|
var _inputRef$current;
|
|
97
99
|
|
|
98
100
|
var value = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
|
|
99
|
-
|
|
101
|
+
var isSettedMaxDate = !disabledFormattedMaxDate && value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).format(format) === 'Invalid date';
|
|
102
|
+
if (isSettedMaxDate) onChange(formattedMaxDate !== null && formattedMaxDate !== void 0 ? formattedMaxDate : '');else 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));
|
|
100
103
|
};
|
|
101
104
|
|
|
102
105
|
var onKeyDown = function onKeyDown(e) {
|