@mui/x-date-pickers 7.0.0-alpha.1 → 7.0.0-alpha.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.
- package/AdapterDateFns/AdapterDateFns.d.ts +2 -2
- package/AdapterDateFns/AdapterDateFns.js +1 -3
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -2
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -3
- package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
- package/AdapterDayjs/AdapterDayjs.js +2 -7
- package/AdapterLuxon/AdapterLuxon.d.ts +2 -2
- package/AdapterLuxon/AdapterLuxon.js +2 -23
- package/AdapterMoment/AdapterMoment.d.ts +2 -2
- package/AdapterMoment/AdapterMoment.js +2 -9
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +1 -2
- package/AdapterMomentHijri/AdapterMomentHijri.js +0 -3
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +1 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -3
- package/CHANGELOG.md +366 -188
- package/DateCalendar/DateCalendar.js +2 -8
- package/DateCalendar/DateCalendar.types.d.ts +0 -4
- package/DateCalendar/dayCalendarClasses.d.ts +1 -1
- package/DateCalendar/dayCalendarClasses.js +1 -1
- package/DateCalendar/index.d.ts +1 -1
- package/DateCalendar/index.js +1 -1
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateCalendar/useCalendarState.js +1 -9
- package/DateField/DateField.js +1 -1
- package/DatePicker/DatePicker.js +1 -5
- package/DateTimeField/DateTimeField.js +1 -9
- package/DateTimePicker/DateTimePicker.js +1 -13
- package/DesktopDatePicker/DesktopDatePicker.js +1 -5
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -13
- package/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/DigitalClock/DigitalClock.js +3 -15
- package/MobileDatePicker/MobileDatePicker.js +1 -5
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -13
- package/MobileTimePicker/MobileTimePicker.js +1 -9
- package/MonthCalendar/MonthCalendar.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/PickersDay/PickersDay.js +1 -1
- package/StaticDatePicker/StaticDatePicker.js +1 -5
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -13
- package/StaticTimePicker/StaticTimePicker.js +1 -9
- package/TimeClock/Clock.js +1 -1
- package/TimeClock/TimeClock.js +3 -15
- package/TimeField/TimeField.js +1 -9
- package/TimePicker/TimePicker.js +1 -9
- package/YearCalendar/YearCalendar.js +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +1 -1
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -2
- package/index.js +1 -1
- package/internals/hooks/date-helpers-hooks.js +2 -2
- package/internals/hooks/useField/useField.utils.js +8 -8
- package/internals/hooks/useField/useFieldState.js +1 -1
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +1 -1
- package/internals/hooks/useUtils.js +1 -1
- package/internals/hooks/useViews.js +2 -2
- package/internals/models/validation.d.ts +0 -8
- package/internals/utils/date-utils.js +2 -2
- package/internals/utils/validation/extractValidationProps.d.ts +1 -1
- package/internals/utils/validation/extractValidationProps.js +1 -1
- package/internals/utils/validation/validateDate.js +1 -1
- package/internals/utils/validation/validateTime.js +1 -8
- package/legacy/AdapterDateFns/AdapterDateFns.js +2 -2
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -2
- package/legacy/AdapterDayjs/AdapterDayjs.js +4 -6
- package/legacy/AdapterLuxon/AdapterLuxon.js +4 -22
- package/legacy/AdapterMoment/AdapterMoment.js +4 -8
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +0 -3
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -3
- package/legacy/DateCalendar/DateCalendar.js +2 -8
- package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
- package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
- package/legacy/DateCalendar/index.js +1 -1
- package/legacy/DateCalendar/useCalendarState.js +1 -9
- package/legacy/DateField/DateField.js +1 -1
- package/legacy/DatePicker/DatePicker.js +1 -5
- package/legacy/DateTimeField/DateTimeField.js +1 -9
- package/legacy/DateTimePicker/DateTimePicker.js +1 -13
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -5
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -13
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/legacy/DigitalClock/DigitalClock.js +3 -15
- package/legacy/MobileDatePicker/MobileDatePicker.js +1 -5
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +1 -13
- package/legacy/MobileTimePicker/MobileTimePicker.js +1 -9
- package/legacy/MonthCalendar/MonthCalendar.js +1 -1
- package/legacy/MonthCalendar/PickersMonth.js +4 -5
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/legacy/PickersDay/PickersDay.js +6 -7
- package/legacy/PickersLayout/PickersLayout.js +5 -6
- package/legacy/StaticDatePicker/StaticDatePicker.js +1 -5
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +1 -13
- package/legacy/StaticTimePicker/StaticTimePicker.js +1 -9
- package/legacy/TimeClock/Clock.js +1 -1
- package/legacy/TimeClock/ClockNumber.js +4 -5
- package/legacy/TimeClock/TimeClock.js +3 -15
- package/legacy/TimeField/TimeField.js +1 -9
- package/legacy/TimePicker/TimePicker.js +1 -9
- package/legacy/TimePicker/TimePickerToolbar.js +1 -2
- package/legacy/YearCalendar/PickersYear.js +4 -5
- package/legacy/YearCalendar/YearCalendar.js +1 -1
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -2
- package/legacy/index.js +1 -1
- package/legacy/internals/components/PickersModalDialog.js +3 -4
- package/legacy/internals/hooks/date-helpers-hooks.js +2 -2
- package/legacy/internals/hooks/useField/useField.utils.js +8 -8
- package/legacy/internals/hooks/useField/useFieldState.js +1 -1
- package/legacy/internals/hooks/useUtils.js +1 -1
- package/legacy/internals/hooks/useViews.js +2 -2
- package/legacy/internals/utils/date-utils.js +2 -2
- package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
- package/legacy/internals/utils/validation/validateDate.js +1 -1
- package/legacy/internals/utils/validation/validateTime.js +1 -8
- package/legacy/locales/deDE.js +4 -3
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/mk.js +91 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -6
- package/locales/deDE.js +2 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/mk.d.ts +53 -0
- package/locales/mk.js +55 -0
- package/models/adapters.d.ts +6 -10
- package/models/timezone.d.ts +1 -1
- package/models/validation.d.ts +1 -1
- package/modern/AdapterDateFns/AdapterDateFns.js +1 -3
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -3
- package/modern/AdapterDayjs/AdapterDayjs.js +2 -7
- package/modern/AdapterLuxon/AdapterLuxon.js +2 -23
- package/modern/AdapterMoment/AdapterMoment.js +2 -9
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +0 -3
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -3
- package/modern/DateCalendar/DateCalendar.js +2 -8
- package/modern/DateCalendar/dayCalendarClasses.js +1 -1
- package/modern/DateCalendar/index.js +1 -1
- package/modern/DateCalendar/useCalendarState.js +1 -9
- package/modern/DateField/DateField.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -5
- package/modern/DateTimeField/DateTimeField.js +1 -9
- package/modern/DateTimePicker/DateTimePicker.js +1 -13
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -5
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -13
- package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/modern/DigitalClock/DigitalClock.js +3 -15
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -5
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -13
- package/modern/MobileTimePicker/MobileTimePicker.js +1 -9
- package/modern/MonthCalendar/MonthCalendar.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/modern/PickersDay/PickersDay.js +1 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -5
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -13
- package/modern/StaticTimePicker/StaticTimePicker.js +1 -9
- package/modern/TimeClock/Clock.js +1 -1
- package/modern/TimeClock/TimeClock.js +3 -15
- package/modern/TimeField/TimeField.js +1 -9
- package/modern/TimePicker/TimePicker.js +1 -9
- package/modern/YearCalendar/YearCalendar.js +1 -1
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -2
- package/modern/index.js +1 -1
- package/modern/internals/hooks/date-helpers-hooks.js +2 -2
- package/modern/internals/hooks/useField/useField.utils.js +8 -8
- package/modern/internals/hooks/useField/useFieldState.js +1 -1
- package/modern/internals/hooks/useUtils.js +1 -1
- package/modern/internals/hooks/useViews.js +2 -2
- package/modern/internals/utils/date-utils.js +2 -2
- package/modern/internals/utils/validation/extractValidationProps.js +1 -1
- package/modern/internals/utils/validation/validateDate.js +1 -1
- package/modern/internals/utils/validation/validateTime.js +1 -8
- package/modern/locales/deDE.js +2 -3
- package/modern/locales/index.js +1 -0
- package/modern/locales/mk.js +55 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -6
- package/node/AdapterDateFns/AdapterDateFns.js +1 -3
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +1 -3
- package/node/AdapterDayjs/AdapterDayjs.js +2 -7
- package/node/AdapterLuxon/AdapterLuxon.js +2 -23
- package/node/AdapterMoment/AdapterMoment.js +2 -9
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +0 -3
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -3
- package/node/DateCalendar/DateCalendar.js +2 -8
- package/node/DateCalendar/dayCalendarClasses.js +2 -2
- package/node/DateCalendar/index.js +2 -2
- package/node/DateCalendar/useCalendarState.js +1 -9
- package/node/DateField/DateField.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -5
- package/node/DateTimeField/DateTimeField.js +1 -9
- package/node/DateTimePicker/DateTimePicker.js +1 -13
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -5
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -13
- package/node/DesktopTimePicker/DesktopTimePicker.js +1 -9
- package/node/DigitalClock/DigitalClock.js +3 -15
- package/node/MobileDatePicker/MobileDatePicker.js +1 -5
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -13
- package/node/MobileTimePicker/MobileTimePicker.js +1 -9
- package/node/MonthCalendar/MonthCalendar.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +3 -15
- package/node/PickersDay/PickersDay.js +1 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -5
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -13
- package/node/StaticTimePicker/StaticTimePicker.js +1 -9
- package/node/TimeClock/Clock.js +1 -1
- package/node/TimeClock/TimeClock.js +3 -15
- package/node/TimeField/TimeField.js +1 -9
- package/node/TimePicker/TimePicker.js +1 -9
- package/node/YearCalendar/YearCalendar.js +1 -1
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
- package/node/dateViewRenderers/dateViewRenderers.js +0 -2
- package/node/index.js +1 -1
- package/node/internals/hooks/date-helpers-hooks.js +2 -2
- package/node/internals/hooks/useField/useField.utils.js +8 -8
- package/node/internals/hooks/useField/useFieldState.js +1 -1
- package/node/internals/hooks/useUtils.js +1 -1
- package/node/internals/hooks/useViews.js +2 -2
- package/node/internals/utils/date-utils.js +2 -2
- package/node/internals/utils/validation/extractValidationProps.js +1 -1
- package/node/internals/utils/validation/validateDate.js +1 -1
- package/node/internals/utils/validation/validateTime.js +1 -8
- package/node/locales/deDE.js +2 -3
- package/node/locales/index.js +11 -0
- package/node/locales/mk.js +60 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -6
- package/package.json +7 -6
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -6
|
@@ -100,10 +100,6 @@ DesktopDatePicker.propTypes = {
|
|
|
100
100
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
101
101
|
*/
|
|
102
102
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
103
|
-
/**
|
|
104
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
105
|
-
*/
|
|
106
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
107
103
|
/**
|
|
108
104
|
* The default value.
|
|
109
105
|
* Used when the component is not controlled.
|
|
@@ -342,7 +338,7 @@ DesktopDatePicker.propTypes = {
|
|
|
342
338
|
* Choose which timezone to use for the value.
|
|
343
339
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
344
340
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
345
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
341
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
346
342
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
347
343
|
*/
|
|
348
344
|
timezone: _propTypes.default.string,
|
|
@@ -149,10 +149,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
149
149
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
150
150
|
*/
|
|
151
151
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
152
|
-
/**
|
|
153
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
154
|
-
*/
|
|
155
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
156
152
|
/**
|
|
157
153
|
* The default value.
|
|
158
154
|
* Used when the component is not controlled.
|
|
@@ -366,14 +362,6 @@ DesktopDateTimePicker.propTypes = {
|
|
|
366
362
|
endIndex: _propTypes.default.number.isRequired,
|
|
367
363
|
startIndex: _propTypes.default.number.isRequired
|
|
368
364
|
})]),
|
|
369
|
-
/**
|
|
370
|
-
* Disable specific clock time.
|
|
371
|
-
* @param {number} clockValue The value to check.
|
|
372
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
373
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
374
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
375
|
-
*/
|
|
376
|
-
shouldDisableClock: _propTypes.default.func,
|
|
377
365
|
/**
|
|
378
366
|
* Disable specific date.
|
|
379
367
|
*
|
|
@@ -456,7 +444,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
456
444
|
* Choose which timezone to use for the value.
|
|
457
445
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
458
446
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
459
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
447
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
460
448
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
461
449
|
*/
|
|
462
450
|
timezone: _propTypes.default.string,
|
|
@@ -278,14 +278,6 @@ DesktopTimePicker.propTypes = {
|
|
|
278
278
|
endIndex: _propTypes.default.number.isRequired,
|
|
279
279
|
startIndex: _propTypes.default.number.isRequired
|
|
280
280
|
})]),
|
|
281
|
-
/**
|
|
282
|
-
* Disable specific clock time.
|
|
283
|
-
* @param {number} clockValue The value to check.
|
|
284
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
285
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
286
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
287
|
-
*/
|
|
288
|
-
shouldDisableClock: _propTypes.default.func,
|
|
289
281
|
/**
|
|
290
282
|
* Disable specific time.
|
|
291
283
|
* @template TDate
|
|
@@ -333,7 +325,7 @@ DesktopTimePicker.propTypes = {
|
|
|
333
325
|
* Choose which timezone to use for the value.
|
|
334
326
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
335
327
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
336
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
328
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
337
329
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
338
330
|
*/
|
|
339
331
|
timezone: _propTypes.default.string,
|
|
@@ -27,7 +27,7 @@ var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
|
27
27
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
28
28
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
29
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
|
-
const _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
30
|
+
const _excluded = ["ampm", "timeStep", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "views", "skipDisabled", "timezone"];
|
|
31
31
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
32
32
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
33
|
const useUtilityClasses = ownerState => {
|
|
@@ -121,7 +121,6 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
121
121
|
disableFuture,
|
|
122
122
|
disablePast,
|
|
123
123
|
minutesStep = 1,
|
|
124
|
-
shouldDisableClock,
|
|
125
124
|
shouldDisableTime,
|
|
126
125
|
onChange,
|
|
127
126
|
view: inView,
|
|
@@ -221,16 +220,13 @@ const DigitalClock = exports.DigitalClock = /*#__PURE__*/React.forwardRef(functi
|
|
|
221
220
|
if (utils.getMinutes(valueToCheck) % minutesStep !== 0) {
|
|
222
221
|
return false;
|
|
223
222
|
}
|
|
224
|
-
if (shouldDisableClock?.(utils.toJsDate(valueToCheck).getTime(), 'hours')) {
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
223
|
if (shouldDisableTime) {
|
|
228
224
|
return !shouldDisableTime(valueToCheck, 'hours');
|
|
229
225
|
}
|
|
230
226
|
return true;
|
|
231
227
|
};
|
|
232
228
|
return !containsValidTime() || !isValidValue();
|
|
233
|
-
}, [disableIgnoringDatePartForTimeValidation, utils, minTime, maxTime, disableFuture, now, disablePast, minutesStep,
|
|
229
|
+
}, [disableIgnoringDatePartForTimeValidation, utils, minTime, maxTime, disableFuture, now, disablePast, minutesStep, shouldDisableTime]);
|
|
234
230
|
const timeOptions = React.useMemo(() => {
|
|
235
231
|
const startOfDay = utils.startOfDay(valueOrReferenceDate);
|
|
236
232
|
return [startOfDay, ...Array.from({
|
|
@@ -375,14 +371,6 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
375
371
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
376
372
|
*/
|
|
377
373
|
referenceDate: _propTypes.default.any,
|
|
378
|
-
/**
|
|
379
|
-
* Disable specific clock time.
|
|
380
|
-
* @param {number} clockValue The value to check.
|
|
381
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
382
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
383
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
384
|
-
*/
|
|
385
|
-
shouldDisableClock: _propTypes.default.func,
|
|
386
374
|
/**
|
|
387
375
|
* Disable specific time.
|
|
388
376
|
* @template TDate
|
|
@@ -420,7 +408,7 @@ process.env.NODE_ENV !== "production" ? DigitalClock.propTypes = {
|
|
|
420
408
|
* Choose which timezone to use for the value.
|
|
421
409
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
422
410
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
423
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
411
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
424
412
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
425
413
|
*/
|
|
426
414
|
timezone: _propTypes.default.string,
|
|
@@ -97,10 +97,6 @@ MobileDatePicker.propTypes = {
|
|
|
97
97
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
98
98
|
*/
|
|
99
99
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
100
|
-
/**
|
|
101
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
102
|
-
*/
|
|
103
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
104
100
|
/**
|
|
105
101
|
* The default value.
|
|
106
102
|
* Used when the component is not controlled.
|
|
@@ -339,7 +335,7 @@ MobileDatePicker.propTypes = {
|
|
|
339
335
|
* Choose which timezone to use for the value.
|
|
340
336
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
341
337
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
342
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
338
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
343
339
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
344
340
|
*/
|
|
345
341
|
timezone: _propTypes.default.string,
|
|
@@ -118,10 +118,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
118
118
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
119
119
|
*/
|
|
120
120
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
121
|
-
/**
|
|
122
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
123
|
-
*/
|
|
124
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
125
121
|
/**
|
|
126
122
|
* The default value.
|
|
127
123
|
* Used when the component is not controlled.
|
|
@@ -335,14 +331,6 @@ MobileDateTimePicker.propTypes = {
|
|
|
335
331
|
endIndex: _propTypes.default.number.isRequired,
|
|
336
332
|
startIndex: _propTypes.default.number.isRequired
|
|
337
333
|
})]),
|
|
338
|
-
/**
|
|
339
|
-
* Disable specific clock time.
|
|
340
|
-
* @param {number} clockValue The value to check.
|
|
341
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
342
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
343
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
344
|
-
*/
|
|
345
|
-
shouldDisableClock: _propTypes.default.func,
|
|
346
334
|
/**
|
|
347
335
|
* Disable specific date.
|
|
348
336
|
*
|
|
@@ -404,7 +392,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
404
392
|
* Choose which timezone to use for the value.
|
|
405
393
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
406
394
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
407
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
395
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
408
396
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
409
397
|
*/
|
|
410
398
|
timezone: _propTypes.default.string,
|
|
@@ -257,14 +257,6 @@ MobileTimePicker.propTypes = {
|
|
|
257
257
|
endIndex: _propTypes.default.number.isRequired,
|
|
258
258
|
startIndex: _propTypes.default.number.isRequired
|
|
259
259
|
})]),
|
|
260
|
-
/**
|
|
261
|
-
* Disable specific clock time.
|
|
262
|
-
* @param {number} clockValue The value to check.
|
|
263
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
264
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
265
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
266
|
-
*/
|
|
267
|
-
shouldDisableClock: _propTypes.default.func,
|
|
268
260
|
/**
|
|
269
261
|
* Disable specific time.
|
|
270
262
|
* @template TDate
|
|
@@ -291,7 +283,7 @@ MobileTimePicker.propTypes = {
|
|
|
291
283
|
* Choose which timezone to use for the value.
|
|
292
284
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
293
285
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
294
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
286
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
295
287
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
296
288
|
*/
|
|
297
289
|
timezone: _propTypes.default.string,
|
|
@@ -325,7 +325,7 @@ process.env.NODE_ENV !== "production" ? MonthCalendar.propTypes = {
|
|
|
325
325
|
* Choose which timezone to use for the value.
|
|
326
326
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
327
327
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
328
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
328
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
329
329
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
330
330
|
*/
|
|
331
331
|
timezone: _propTypes.default.string,
|
|
@@ -26,7 +26,7 @@ var _valueManagers = require("../internals/utils/valueManagers");
|
|
|
26
26
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
27
27
|
var _dateUtils = require("../internals/utils/date-utils");
|
|
28
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
29
|
+
const _excluded = ["ampm", "timeSteps", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "skipDisabled", "timezone"];
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
const useUtilityClasses = ownerState => {
|
|
@@ -81,7 +81,6 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
81
81
|
disableFuture,
|
|
82
82
|
disablePast,
|
|
83
83
|
minutesStep = 1,
|
|
84
|
-
shouldDisableClock,
|
|
85
84
|
shouldDisableTime,
|
|
86
85
|
onChange,
|
|
87
86
|
view: inView,
|
|
@@ -175,9 +174,6 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
175
174
|
if (timeValue % step !== 0) {
|
|
176
175
|
return false;
|
|
177
176
|
}
|
|
178
|
-
if (shouldDisableClock?.(timeValue, viewType)) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
177
|
if (shouldDisableTime) {
|
|
182
178
|
switch (viewType) {
|
|
183
179
|
case 'hours':
|
|
@@ -227,7 +223,7 @@ const MultiSectionDigitalClock = exports.MultiSectionDigitalClock = /*#__PURE__*
|
|
|
227
223
|
default:
|
|
228
224
|
throw new Error('not supported');
|
|
229
225
|
}
|
|
230
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep,
|
|
226
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
|
|
231
227
|
const handleSectionChange = (0, _useEventCallback.default)((sectionView, newValue) => {
|
|
232
228
|
const viewIndex = views.indexOf(sectionView);
|
|
233
229
|
const nextView = views[viewIndex + 1];
|
|
@@ -443,14 +439,6 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
443
439
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
444
440
|
*/
|
|
445
441
|
referenceDate: _propTypes.default.any,
|
|
446
|
-
/**
|
|
447
|
-
* Disable specific clock time.
|
|
448
|
-
* @param {number} clockValue The value to check.
|
|
449
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
450
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
451
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
452
|
-
*/
|
|
453
|
-
shouldDisableClock: _propTypes.default.func,
|
|
454
442
|
/**
|
|
455
443
|
* Disable specific time.
|
|
456
444
|
* @template TDate
|
|
@@ -492,7 +480,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
492
480
|
* Choose which timezone to use for the value.
|
|
493
481
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
494
482
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
495
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
483
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
496
484
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
497
485
|
*/
|
|
498
486
|
timezone: _propTypes.default.string,
|
|
@@ -165,7 +165,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
|
|
|
165
165
|
}
|
|
166
166
|
}, [autoFocus, disabled, isAnimating, outsideCurrentMonth]);
|
|
167
167
|
|
|
168
|
-
// For day outside
|
|
168
|
+
// For a day outside the current month, move the focus from mouseDown to mouseUp
|
|
169
169
|
// Goal: have the onClick ends before sliding to the new month
|
|
170
170
|
const handleMouseDown = event => {
|
|
171
171
|
onMouseDown(event);
|
|
@@ -79,10 +79,6 @@ StaticDatePicker.propTypes = {
|
|
|
79
79
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
80
80
|
*/
|
|
81
81
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
82
|
-
/**
|
|
83
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
84
|
-
*/
|
|
85
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
86
82
|
/**
|
|
87
83
|
* The default value.
|
|
88
84
|
* Used when the component is not controlled.
|
|
@@ -275,7 +271,7 @@ StaticDatePicker.propTypes = {
|
|
|
275
271
|
* Choose which timezone to use for the value.
|
|
276
272
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
277
273
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
278
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
274
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
279
275
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
280
276
|
*/
|
|
281
277
|
timezone: _propTypes.default.string,
|
|
@@ -99,10 +99,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
99
99
|
* @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
|
|
100
100
|
*/
|
|
101
101
|
dayOfWeekFormatter: _propTypes.default.func,
|
|
102
|
-
/**
|
|
103
|
-
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
104
|
-
*/
|
|
105
|
-
defaultCalendarMonth: _propTypes.default.any,
|
|
106
102
|
/**
|
|
107
103
|
* The default value.
|
|
108
104
|
* Used when the component is not controlled.
|
|
@@ -270,14 +266,6 @@ StaticDateTimePicker.propTypes = {
|
|
|
270
266
|
* @default () => <span data-mui-test="loading-progress">...</span>
|
|
271
267
|
*/
|
|
272
268
|
renderLoading: _propTypes.default.func,
|
|
273
|
-
/**
|
|
274
|
-
* Disable specific clock time.
|
|
275
|
-
* @param {number} clockValue The value to check.
|
|
276
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
277
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
278
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
279
|
-
*/
|
|
280
|
-
shouldDisableClock: _propTypes.default.func,
|
|
281
269
|
/**
|
|
282
270
|
* Disable specific date.
|
|
283
271
|
*
|
|
@@ -339,7 +327,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
339
327
|
* Choose which timezone to use for the value.
|
|
340
328
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
341
329
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
342
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
330
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
343
331
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
344
332
|
*/
|
|
345
333
|
timezone: _propTypes.default.string,
|
|
@@ -191,14 +191,6 @@ StaticTimePicker.propTypes = {
|
|
|
191
191
|
* @default The closest valid date-time using the validation props, except callbacks like `shouldDisable<...>`.
|
|
192
192
|
*/
|
|
193
193
|
referenceDate: _propTypes.default.any,
|
|
194
|
-
/**
|
|
195
|
-
* Disable specific clock time.
|
|
196
|
-
* @param {number} clockValue The value to check.
|
|
197
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
198
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
199
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
200
|
-
*/
|
|
201
|
-
shouldDisableClock: _propTypes.default.func,
|
|
202
194
|
/**
|
|
203
195
|
* Disable specific time.
|
|
204
196
|
* @template TDate
|
|
@@ -225,7 +217,7 @@ StaticTimePicker.propTypes = {
|
|
|
225
217
|
* Choose which timezone to use for the value.
|
|
226
218
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
227
219
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
228
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
220
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
229
221
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
230
222
|
*/
|
|
231
223
|
timezone: _propTypes.default.string,
|
package/node/TimeClock/Clock.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useValueWithTimezone = require("../internals/hooks/useValueWithTimezone");
|
|
|
25
25
|
var _valueManagers = require("../internals/utils/valueManagers");
|
|
26
26
|
var _useClockReferenceDate = require("../internals/hooks/useClockReferenceDate");
|
|
27
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "
|
|
28
|
+
const _excluded = ["ampm", "ampmInClock", "autoFocus", "slots", "slotProps", "value", "defaultValue", "referenceDate", "disableIgnoringDatePartForTimeValidation", "maxTime", "minTime", "disableFuture", "disablePast", "minutesStep", "shouldDisableTime", "showViewSwitcher", "onChange", "view", "views", "openTo", "onViewChange", "focusedView", "onFocusedViewChange", "className", "disabled", "readOnly", "timezone"];
|
|
29
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
30
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
31
31
|
const useUtilityClasses = ownerState => {
|
|
@@ -89,7 +89,6 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
89
89
|
disableFuture,
|
|
90
90
|
disablePast,
|
|
91
91
|
minutesStep = 1,
|
|
92
|
-
shouldDisableClock,
|
|
93
92
|
shouldDisableTime,
|
|
94
93
|
showViewSwitcher,
|
|
95
94
|
onChange,
|
|
@@ -170,9 +169,6 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
170
169
|
if (timeValue % step !== 0) {
|
|
171
170
|
return false;
|
|
172
171
|
}
|
|
173
|
-
if (shouldDisableClock?.(timeValue, viewType)) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
172
|
if (shouldDisableTime) {
|
|
177
173
|
switch (viewType) {
|
|
178
174
|
case 'hours':
|
|
@@ -222,7 +218,7 @@ const TimeClock = exports.TimeClock = /*#__PURE__*/React.forwardRef(function Tim
|
|
|
222
218
|
default:
|
|
223
219
|
throw new Error('not supported');
|
|
224
220
|
}
|
|
225
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep,
|
|
221
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, utils, disableFuture, disablePast, now, views]);
|
|
226
222
|
const selectedId = (0, _utils.unstable_useId)();
|
|
227
223
|
const viewProps = React.useMemo(() => {
|
|
228
224
|
switch (view) {
|
|
@@ -430,14 +426,6 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
430
426
|
* @default The closest valid time using the validation props, except callbacks such as `shouldDisableTime`.
|
|
431
427
|
*/
|
|
432
428
|
referenceDate: _propTypes.default.any,
|
|
433
|
-
/**
|
|
434
|
-
* Disable specific clock time.
|
|
435
|
-
* @param {number} clockValue The value to check.
|
|
436
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
437
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
438
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
439
|
-
*/
|
|
440
|
-
shouldDisableClock: _propTypes.default.func,
|
|
441
429
|
/**
|
|
442
430
|
* Disable specific time.
|
|
443
431
|
* @template TDate
|
|
@@ -465,7 +453,7 @@ process.env.NODE_ENV !== "production" ? TimeClock.propTypes = {
|
|
|
465
453
|
* Choose which timezone to use for the value.
|
|
466
454
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
467
455
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
468
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
456
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
469
457
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
470
458
|
*/
|
|
471
459
|
timezone: _propTypes.default.string,
|
|
@@ -295,14 +295,6 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
295
295
|
endIndex: _propTypes.default.number.isRequired,
|
|
296
296
|
startIndex: _propTypes.default.number.isRequired
|
|
297
297
|
})]),
|
|
298
|
-
/**
|
|
299
|
-
* Disable specific clock time.
|
|
300
|
-
* @param {number} clockValue The value to check.
|
|
301
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
302
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
303
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
304
|
-
*/
|
|
305
|
-
shouldDisableClock: _propTypes.default.func,
|
|
306
298
|
/**
|
|
307
299
|
* Disable specific time.
|
|
308
300
|
* @template TDate
|
|
@@ -349,7 +341,7 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
349
341
|
* Choose which timezone to use for the value.
|
|
350
342
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
351
343
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
352
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
344
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
353
345
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
354
346
|
*/
|
|
355
347
|
timezone: _propTypes.default.string,
|
|
@@ -242,14 +242,6 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
242
242
|
endIndex: _propTypes.default.number.isRequired,
|
|
243
243
|
startIndex: _propTypes.default.number.isRequired
|
|
244
244
|
})]),
|
|
245
|
-
/**
|
|
246
|
-
* Disable specific clock time.
|
|
247
|
-
* @param {number} clockValue The value to check.
|
|
248
|
-
* @param {TimeView} view The clock type of the timeValue.
|
|
249
|
-
* @returns {boolean} If `true` the time will be disabled.
|
|
250
|
-
* @deprecated Consider using `shouldDisableTime`.
|
|
251
|
-
*/
|
|
252
|
-
shouldDisableClock: _propTypes.default.func,
|
|
253
245
|
/**
|
|
254
246
|
* Disable specific time.
|
|
255
247
|
* @template TDate
|
|
@@ -297,7 +289,7 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
|
|
|
297
289
|
* Choose which timezone to use for the value.
|
|
298
290
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
299
291
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
300
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
292
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
301
293
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
302
294
|
*/
|
|
303
295
|
timezone: _propTypes.default.string,
|
|
@@ -344,7 +344,7 @@ process.env.NODE_ENV !== "production" ? YearCalendar.propTypes = {
|
|
|
344
344
|
* Choose which timezone to use for the value.
|
|
345
345
|
* Example: "default", "system", "UTC", "America/New_York".
|
|
346
346
|
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
347
|
-
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones
|
|
347
|
+
* @see See the {@link https://mui.com/x/react-date-pickers/timezone/ timezones documentation} for more details.
|
|
348
348
|
* @default The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise.
|
|
349
349
|
*/
|
|
350
350
|
timezone: _propTypes.default.string,
|
|
@@ -42,7 +42,6 @@ const renderDesktopDateTimeView = ({
|
|
|
42
42
|
shouldDisableMonth,
|
|
43
43
|
shouldDisableYear,
|
|
44
44
|
shouldDisableTime,
|
|
45
|
-
shouldDisableClock,
|
|
46
45
|
reduceAnimations,
|
|
47
46
|
minutesStep,
|
|
48
47
|
ampm,
|
|
@@ -50,7 +49,6 @@ const renderDesktopDateTimeView = ({
|
|
|
50
49
|
monthsPerRow,
|
|
51
50
|
onYearChange,
|
|
52
51
|
yearsPerRow,
|
|
53
|
-
defaultCalendarMonth,
|
|
54
52
|
slots,
|
|
55
53
|
slotProps,
|
|
56
54
|
loading,
|
|
@@ -89,7 +87,6 @@ const renderDesktopDateTimeView = ({
|
|
|
89
87
|
minTime,
|
|
90
88
|
maxTime,
|
|
91
89
|
shouldDisableTime,
|
|
92
|
-
shouldDisableClock,
|
|
93
90
|
minutesStep,
|
|
94
91
|
ampm,
|
|
95
92
|
slots,
|
|
@@ -128,7 +125,6 @@ const renderDesktopDateTimeView = ({
|
|
|
128
125
|
monthsPerRow: monthsPerRow,
|
|
129
126
|
onYearChange: onYearChange,
|
|
130
127
|
yearsPerRow: yearsPerRow,
|
|
131
|
-
defaultCalendarMonth: defaultCalendarMonth,
|
|
132
128
|
slots: slots,
|
|
133
129
|
slotProps: slotProps,
|
|
134
130
|
loading: loading,
|
|
@@ -34,7 +34,6 @@ const renderDateViewCalendar = ({
|
|
|
34
34
|
monthsPerRow,
|
|
35
35
|
onYearChange,
|
|
36
36
|
yearsPerRow,
|
|
37
|
-
defaultCalendarMonth,
|
|
38
37
|
slots,
|
|
39
38
|
slotProps,
|
|
40
39
|
loading,
|
|
@@ -73,7 +72,6 @@ const renderDateViewCalendar = ({
|
|
|
73
72
|
monthsPerRow: monthsPerRow,
|
|
74
73
|
onYearChange: onYearChange,
|
|
75
74
|
yearsPerRow: yearsPerRow,
|
|
76
|
-
defaultCalendarMonth: defaultCalendarMonth,
|
|
77
75
|
slots: slots,
|
|
78
76
|
slotProps: slotProps,
|
|
79
77
|
loading: loading,
|
package/node/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function useNextMonthDisabled(month, {
|
|
|
18
18
|
}) {
|
|
19
19
|
const utils = (0, _useUtils.useUtils)();
|
|
20
20
|
return React.useMemo(() => {
|
|
21
|
-
const now = utils.
|
|
21
|
+
const now = utils.date(undefined, timezone);
|
|
22
22
|
const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
|
|
23
23
|
return !utils.isAfter(lastEnabledMonth, month);
|
|
24
24
|
}, [disableFuture, maxDate, month, utils, timezone]);
|
|
@@ -30,7 +30,7 @@ function usePreviousMonthDisabled(month, {
|
|
|
30
30
|
}) {
|
|
31
31
|
const utils = (0, _useUtils.useUtils)();
|
|
32
32
|
return React.useMemo(() => {
|
|
33
|
-
const now = utils.
|
|
33
|
+
const now = utils.date(undefined, timezone);
|
|
34
34
|
const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
|
|
35
35
|
return !utils.isBefore(firstEnabledMonth, month);
|
|
36
36
|
}, [disablePast, minDate, month, utils, timezone]);
|