diginet-core-ui 1.4.69-beta.1 → 1.4.69-beta.2
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.
|
@@ -142,8 +142,15 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
142
142
|
// return moment(value).format(format, utc = false);
|
|
143
143
|
return parseDateString(value, lowerCaseDayYear(formatStr), dateLocale);
|
|
144
144
|
};
|
|
145
|
-
const onChangeValue = e => {
|
|
146
|
-
|
|
145
|
+
const onChangeValue = (e, type) => {
|
|
146
|
+
let vl = (e === null || e === void 0 ? void 0 : e.value) || e;
|
|
147
|
+
if (type === 'input') {
|
|
148
|
+
const dateval = new Date(vl);
|
|
149
|
+
const datemax = new Date(max);
|
|
150
|
+
const datemin = new Date(min);
|
|
151
|
+
if (dateval < datemin) vl = datemin;
|
|
152
|
+
if (dateval > datemax) vl = datemax;
|
|
153
|
+
}
|
|
147
154
|
closePicker();
|
|
148
155
|
setValue(vl);
|
|
149
156
|
if (timer.current) clearTimeout(timer.current);
|
|
@@ -259,7 +266,7 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef((inProps, referenc
|
|
|
259
266
|
format: displayFormat,
|
|
260
267
|
value: valueDateInput,
|
|
261
268
|
onBlur: _onBlur,
|
|
262
|
-
onChange: onChangeValue
|
|
269
|
+
onChange: e => onChangeValue(e, 'input')
|
|
263
270
|
}) : jsx(InputBase, {
|
|
264
271
|
inputProps: {
|
|
265
272
|
placeholder: !readOnly && !disabled ? placeholder : '',
|