@mui/x-date-pickers-pro 7.22.2 → 8.0.0-alpha.0

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +142 -155
  2. package/DateRangeCalendar/DateRangeCalendar.d.ts +1 -2
  3. package/DateRangeCalendar/DateRangeCalendar.js +23 -22
  4. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +24 -36
  5. package/DateRangeCalendar/useDragRange.d.ts +10 -9
  6. package/DateRangeCalendar/useDragRange.js +3 -3
  7. package/DateRangePicker/DateRangePicker.d.ts +1 -2
  8. package/DateRangePicker/DateRangePicker.js +12 -8
  9. package/DateRangePicker/DateRangePicker.types.d.ts +12 -6
  10. package/DateRangePicker/DateRangePickerToolbar.d.ts +3 -5
  11. package/DateRangePicker/DateRangePickerToolbar.js +12 -2
  12. package/DateRangePicker/index.d.ts +1 -1
  13. package/DateRangePicker/shared.d.ts +12 -12
  14. package/DateRangePickerDay/DateRangePickerDay.d.ts +2 -3
  15. package/DateTimeRangePicker/DateTimeRangePicker.d.ts +1 -2
  16. package/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  17. package/DateTimeRangePicker/DateTimeRangePicker.types.d.ts +12 -6
  18. package/DateTimeRangePicker/DateTimeRangePickerTabs.d.ts +1 -2
  19. package/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
  20. package/DateTimeRangePicker/DateTimeRangePickerTimeWrapper.d.ts +8 -9
  21. package/DateTimeRangePicker/DateTimeRangePickerToolbar.d.ts +3 -5
  22. package/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
  23. package/DateTimeRangePicker/index.d.ts +1 -1
  24. package/DateTimeRangePicker/shared.d.ts +13 -13
  25. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +1 -2
  26. package/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  27. package/DesktopDateRangePicker/DesktopDateRangePicker.types.d.ts +6 -7
  28. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.d.ts +1 -2
  29. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  30. package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.types.d.ts +6 -7
  31. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +1 -2
  32. package/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  33. package/MobileDateRangePicker/MobileDateRangePicker.types.d.ts +6 -7
  34. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.d.ts +1 -2
  35. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  36. package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.types.d.ts +6 -7
  37. package/MultiInputDateRangeField/MultiInputDateRangeField.d.ts +1 -2
  38. package/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  39. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +9 -10
  40. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.d.ts +1 -2
  41. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  42. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +9 -10
  43. package/MultiInputTimeRangeField/MultiInputTimeRangeField.d.ts +1 -2
  44. package/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  45. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +9 -10
  46. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.d.ts +1 -2
  47. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  48. package/PickersRangeCalendarHeader/PickersRangeCalendarHeader.types.d.ts +3 -3
  49. package/README.md +2 -2
  50. package/SingleInputDateRangeField/SingleInputDateRangeField.d.ts +1 -2
  51. package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  52. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +8 -8
  53. package/SingleInputDateRangeField/useSingleInputDateRangeField.d.ts +1 -2
  54. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.d.ts +1 -2
  55. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  56. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +8 -8
  57. package/SingleInputDateTimeRangeField/useSingleInputDateTimeRangeField.d.ts +1 -2
  58. package/SingleInputTimeRangeField/SingleInputTimeRangeField.d.ts +1 -2
  59. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  60. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +8 -8
  61. package/SingleInputTimeRangeField/useSingleInputTimeRangeField.d.ts +1 -2
  62. package/StaticDateRangePicker/StaticDateRangePicker.d.ts +1 -2
  63. package/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  64. package/StaticDateRangePicker/StaticDateRangePicker.types.d.ts +6 -7
  65. package/dateRangeViewRenderers/dateRangeViewRenderers.d.ts +2 -3
  66. package/index.d.ts +0 -7
  67. package/index.js +1 -7
  68. package/internals/hooks/models/useRangePicker.d.ts +6 -7
  69. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.d.ts +1 -2
  70. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
  71. package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.types.d.ts +6 -7
  72. package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +15 -13
  73. package/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
  74. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.d.ts +1 -2
  75. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
  76. package/internals/hooks/useMobileRangePicker/useMobileRangePicker.types.d.ts +6 -7
  77. package/internals/hooks/useMultiInputFieldSelectedSections.d.ts +1 -1
  78. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.d.ts +1 -2
  79. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.d.ts +1 -2
  80. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.d.ts +1 -2
  81. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.d.ts +1 -2
  82. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
  83. package/internals/hooks/useStaticRangePicker/useStaticRangePicker.types.d.ts +8 -9
  84. package/internals/models/dateRange.d.ts +3 -4
  85. package/internals/models/dateTimeRange.d.ts +5 -10
  86. package/internals/models/fields.d.ts +26 -0
  87. package/internals/models/fields.js +1 -0
  88. package/internals/models/timeRange.d.ts +5 -9
  89. package/internals/utils/date-range-manager.d.ts +10 -9
  90. package/internals/utils/date-utils.d.ts +5 -5
  91. package/internals/utils/releaseInfo.js +1 -1
  92. package/internals/utils/valueManagers.d.ts +5 -6
  93. package/models/dateRange.d.ts +4 -5
  94. package/models/fields.d.ts +5 -32
  95. package/models/range.d.ts +1 -1
  96. package/modern/DateRangeCalendar/DateRangeCalendar.js +23 -22
  97. package/modern/DateRangeCalendar/useDragRange.js +3 -3
  98. package/modern/DateRangePicker/DateRangePicker.js +12 -8
  99. package/modern/DateRangePicker/DateRangePickerToolbar.js +12 -2
  100. package/modern/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  101. package/modern/DateTimeRangePicker/DateTimeRangePickerTabs.js +2 -2
  102. package/modern/DateTimeRangePicker/DateTimeRangePickerToolbar.js +12 -2
  103. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  104. package/modern/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  105. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  106. package/modern/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  107. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  108. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  109. package/modern/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  110. package/modern/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +2 -2
  111. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  112. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  113. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  114. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  115. package/modern/index.js +1 -7
  116. package/modern/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +20 -14
  117. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +4 -4
  118. package/modern/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +21 -15
  119. package/modern/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +5 -5
  120. package/modern/internals/models/fields.js +1 -0
  121. package/modern/internals/utils/releaseInfo.js +1 -1
  122. package/modern/validation/validateDateRange.js +5 -0
  123. package/modern/validation/validateDateTimeRange.js +5 -0
  124. package/modern/validation/validateTimeRange.js +5 -0
  125. package/node/DateRangeCalendar/DateRangeCalendar.js +22 -21
  126. package/node/DateRangeCalendar/useDragRange.js +3 -3
  127. package/node/DateRangePicker/DateRangePicker.js +12 -8
  128. package/node/DateRangePicker/DateRangePickerToolbar.js +11 -1
  129. package/node/DateTimeRangePicker/DateTimeRangePicker.js +13 -10
  130. package/node/DateTimeRangePicker/DateTimeRangePickerTabs.js +1 -1
  131. package/node/DateTimeRangePicker/DateTimeRangePickerToolbar.js +11 -1
  132. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +16 -8
  133. package/node/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +13 -10
  134. package/node/MobileDateRangePicker/MobileDateRangePicker.js +16 -8
  135. package/node/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +13 -10
  136. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +6 -6
  137. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +7 -8
  138. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +6 -6
  139. package/node/PickersRangeCalendarHeader/PickersRangeCalendarHeader.js +1 -1
  140. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -6
  141. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -8
  142. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -6
  143. package/node/StaticDateRangePicker/StaticDateRangePicker.js +11 -7
  144. package/node/index.js +2 -41
  145. package/node/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +19 -13
  146. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +3 -3
  147. package/node/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +19 -13
  148. package/node/internals/hooks/useStaticRangePicker/useStaticRangePicker.js +4 -4
  149. package/node/internals/models/fields.js +5 -0
  150. package/node/internals/utils/releaseInfo.js +1 -1
  151. package/node/validation/validateDateRange.js +4 -0
  152. package/node/validation/validateDateTimeRange.js +4 -0
  153. package/node/validation/validateTimeRange.js +4 -0
  154. package/package.json +5 -5
  155. package/themeAugmentation/props.d.ts +16 -17
  156. package/validation/validateDateRange.d.ts +9 -5
  157. package/validation/validateDateRange.js +5 -0
  158. package/validation/validateDateTimeRange.d.ts +11 -6
  159. package/validation/validateDateTimeRange.js +5 -0
  160. package/validation/validateTimeRange.d.ts +9 -4
  161. package/validation/validateTimeRange.js +5 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
- const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
5
+ const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "classes", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
6
6
  _excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
@@ -15,7 +15,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
15
15
  import composeClasses from '@mui/utils/composeClasses';
16
16
  import useId from '@mui/utils/useId';
17
17
  import { Watermark } from '@mui/x-license';
18
- import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, useControlledValueWithTimezone, useViews } from '@mui/x-date-pickers/internals';
18
+ import { applyDefaultDate, DayCalendar, useDefaultReduceAnimations, useCalendarState, useDefaultDates, useUtils, useNow, DEFAULT_DESKTOP_MODE_MEDIA_QUERY, useControlledValueWithTimezone, useViews, usePickerPrivateContext } from '@mui/x-date-pickers/internals';
19
19
  import { warnOnce } from '@mui/x-internals/warning';
20
20
  import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
21
21
  import { dateRangeCalendarClasses, getDateRangeCalendarUtilityClass } from "./dateRangeCalendarClasses.js";
@@ -97,15 +97,11 @@ function useDateRangeCalendarDefaultizedProps(props, name) {
97
97
  availableRangePositions: themeProps.availableRangePositions ?? ['start', 'end']
98
98
  });
99
99
  }
100
- const useUtilityClasses = ownerState => {
101
- const {
102
- classes,
103
- isDragging
104
- } = ownerState;
100
+ const useUtilityClasses = (classes, ownerState) => {
105
101
  const slots = {
106
102
  root: ['root'],
107
103
  monthContainer: ['monthContainer'],
108
- dayCalendar: [isDragging && 'dayDragging']
104
+ dayCalendar: [ownerState.isDraggingDay && 'dayDragging']
109
105
  };
110
106
  return composeClasses(slots, getDateRangeCalendarUtilityClass, classes);
111
107
  };
@@ -130,6 +126,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
130
126
  referenceDate,
131
127
  onChange,
132
128
  className,
129
+ classes: classesProp,
133
130
  disableFuture,
134
131
  disablePast,
135
132
  minDate,
@@ -244,10 +241,13 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
244
241
  draggingDatePosition
245
242
  } = _useDragRange,
246
243
  dragEventHandlers = _objectWithoutPropertiesLoose(_useDragRange, _excluded2);
247
- const ownerState = _extends({}, props, {
248
- isDragging
244
+ const {
245
+ ownerState: pickersOwnerState
246
+ } = usePickerPrivateContext();
247
+ const ownerState = _extends({}, pickersOwnerState, {
248
+ isDraggingDay: isDragging
249
249
  });
250
- const classes = useUtilityClasses(ownerState);
250
+ const classes = useUtilityClasses(classesProp, ownerState);
251
251
  const draggingRange = React.useMemo(() => {
252
252
  if (!valueDayRange[0] || !valueDayRange[1] || !rangeDragDay) {
253
253
  return [null, null];
@@ -309,7 +309,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
309
309
  slots,
310
310
  slotProps
311
311
  },
312
- ownerState: props
312
+ ownerState
313
313
  });
314
314
  const prevValue = React.useRef(null);
315
315
  React.useEffect(() => {
@@ -370,7 +370,8 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
370
370
  const slotPropsForDayCalendar = _extends({}, slotProps, {
371
371
  day: dayOwnerState => {
372
372
  const {
373
- day
373
+ day,
374
+ isDaySelected
374
375
  } = dayOwnerState;
375
376
  const isSelectedStartDate = isStartOfRange(utils, day, valueDayRange);
376
377
  const isSelectedEndDate = isEndOfRange(utils, day, valueDayRange);
@@ -393,7 +394,7 @@ const DateRangeCalendar = /*#__PURE__*/React.forwardRef(function DateRangeCalend
393
394
  isEndOfHighlighting: isDragging ? isEndOfRange(utils, day, draggingRange) : isSelectedEndDate,
394
395
  onMouseEnter: shouldHavePreview ? handleDayMouseEnter : undefined,
395
396
  // apply selected styling to the dragging start or end day
396
- isVisuallySelected: dayOwnerState.selected || isDragging && (isStartOfHighlighting || isEndOfHighlighting),
397
+ isVisuallySelected: isDaySelected || isDragging && (isStartOfHighlighting || isEndOfHighlighting),
397
398
  'data-position': datePosition
398
399
  }, dragEventHandlers, {
399
400
  draggable: isElementDraggable ? true : undefined
@@ -514,9 +515,9 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
514
515
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
515
516
  /**
516
517
  * Formats the day of week displayed in the calendar header.
517
- * @param {TDate} date The date of the day of week provided by the adapter.
518
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
518
519
  * @returns {string} The name to display.
519
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
520
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
520
521
  */
521
522
  dayOfWeekFormatter: PropTypes.func,
522
523
  /**
@@ -536,7 +537,8 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
536
537
  */
537
538
  disableAutoMonthSwitching: PropTypes.bool,
538
539
  /**
539
- * If `true`, the picker and text field are disabled.
540
+ * If `true`, the component is disabled.
541
+ * When disabled, the value cannot be changed and no interaction is possible.
540
542
  * @default false
541
543
  */
542
544
  disabled: PropTypes.bool,
@@ -607,8 +609,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
607
609
  onFocusedViewChange: PropTypes.func,
608
610
  /**
609
611
  * Callback fired on month change.
610
- * @template TDate
611
- * @param {TDate} month The new month.
612
+ * @param {PickerValidDate} month The new month.
612
613
  */
613
614
  onMonthChange: PropTypes.func,
614
615
  /**
@@ -634,7 +635,8 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
634
635
  */
635
636
  rangePosition: PropTypes.oneOf(['end', 'start']),
636
637
  /**
637
- * Make picker read only.
638
+ * If `true`, the component is read-only.
639
+ * When read-only, the value cannot be changed but the user can interact with the interface.
638
640
  * @default false
639
641
  */
640
642
  readOnly: PropTypes.bool,
@@ -659,8 +661,7 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
659
661
  *
660
662
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
661
663
  *
662
- * @template TDate
663
- * @param {TDate} day The date to test.
664
+ * @param {PickerValidDate} day The date to test.
664
665
  * @param {string} position The date to test, 'start' or 'end'.
665
666
  * @returns {boolean} Returns `true` if the date should be disabled.
666
667
  */
@@ -214,9 +214,9 @@ export const useDragRange = ({
214
214
  }) => {
215
215
  const [isDragging, setIsDragging] = React.useState(false);
216
216
  const [rangeDragDay, setRangeDragDay] = React.useState(null);
217
- const handleRangeDragDayChange = useEventCallback(val => {
218
- if (!utils.isEqual(val, rangeDragDay)) {
219
- setRangeDragDay(val);
217
+ const handleRangeDragDayChange = useEventCallback(newValue => {
218
+ if (!utils.isEqual(newValue, rangeDragDay)) {
219
+ setRangeDragDay(newValue);
220
220
  }
221
221
  });
222
222
  const draggingDatePosition = React.useMemo(() => {
@@ -74,9 +74,9 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
74
74
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
75
75
  /**
76
76
  * Formats the day of week displayed in the calendar header.
77
- * @param {TDate} date The date of the day of week provided by the adapter.
77
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
78
78
  * @returns {string} The name to display.
79
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
79
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
80
80
  */
81
81
  dayOfWeekFormatter: PropTypes.func,
82
82
  /**
@@ -102,7 +102,8 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
102
102
  */
103
103
  disableAutoMonthSwitching: PropTypes.bool,
104
104
  /**
105
- * If `true`, the picker and text field are disabled.
105
+ * If `true`, the component is disabled.
106
+ * When disabled, the value cannot be changed and no interaction is possible.
106
107
  * @default false
107
108
  */
108
109
  disabled: PropTypes.bool,
@@ -136,7 +137,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
136
137
  */
137
138
  displayWeekNumber: PropTypes.bool,
138
139
  /**
139
- * @default false
140
+ * @default true
140
141
  */
141
142
  enableAccessibleFieldDOMStructure: PropTypes.any,
142
143
  /**
@@ -224,8 +225,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
224
225
  onError: PropTypes.func,
225
226
  /**
226
227
  * Callback fired on month change.
227
- * @template TDate
228
- * @param {TDate} month The new month.
228
+ * @param {PickerValidDate} month The new month.
229
229
  */
230
230
  onMonthChange: PropTypes.func,
231
231
  /**
@@ -253,6 +253,11 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
253
253
  * Used when the component position is controlled.
254
254
  */
255
255
  rangePosition: PropTypes.oneOf(['end', 'start']),
256
+ /**
257
+ * If `true`, the component is read-only.
258
+ * When read-only, the value cannot be changed but the user can interact with the interface.
259
+ * @default false
260
+ */
256
261
  readOnly: PropTypes.bool,
257
262
  /**
258
263
  * If `true`, disable heavy animations.
@@ -285,8 +290,7 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
285
290
  *
286
291
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
287
292
  *
288
- * @template TDate
289
- * @param {TDate} day The date to test.
293
+ * @param {PickerValidDate} day The date to test.
290
294
  * @param {string} position The date to test, 'start' or 'end'.
291
295
  * @returns {boolean} Returns `true` if the date should be disabled.
292
296
  */
@@ -10,7 +10,7 @@ import Typography from '@mui/material/Typography';
10
10
  import { styled, useThemeProps } from '@mui/material/styles';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
12
  import { PickersToolbar, PickersToolbarButton, useUtils } from '@mui/x-date-pickers/internals';
13
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
13
+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
14
14
  import { getDateRangePickerToolbarUtilityClass } from "./dateRangePickerToolbarClasses.js";
15
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
16
  const useUtilityClasses = ownerState => {
@@ -59,7 +59,7 @@ const DateRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateRangeP
59
59
  className
60
60
  } = props,
61
61
  other = _objectWithoutPropertiesLoose(props, _excluded);
62
- const translations = usePickersTranslations();
62
+ const translations = usePickerTranslations();
63
63
  const startDateValue = start ? utils.formatByString(start, toolbarFormat || utils.formats.shortDate) : translations.start;
64
64
  const endDateValue = end ? utils.formatByString(end, toolbarFormat || utils.formats.shortDate) : translations.end;
65
65
  const ownerState = props;
@@ -99,6 +99,11 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
99
99
  */
100
100
  classes: PropTypes.object,
101
101
  className: PropTypes.string,
102
+ /**
103
+ * If `true`, the component is disabled.
104
+ * When disabled, the value cannot be changed and no interaction is possible.
105
+ * @default false
106
+ */
102
107
  disabled: PropTypes.bool,
103
108
  /**
104
109
  * If `true`, show the toolbar even in desktop mode.
@@ -113,6 +118,11 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
113
118
  */
114
119
  onViewChange: PropTypes.func.isRequired,
115
120
  rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
121
+ /**
122
+ * If `true`, the component is read-only.
123
+ * When read-only, the value cannot be changed but the user can interact with the interface.
124
+ * @default false
125
+ */
116
126
  readOnly: PropTypes.bool,
117
127
  /**
118
128
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -79,9 +79,9 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
79
79
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
80
80
  /**
81
81
  * Formats the day of week displayed in the calendar header.
82
- * @param {TDate} date The date of the day of week provided by the adapter.
82
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
83
83
  * @returns {string} The name to display.
84
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
84
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
85
85
  */
86
86
  dayOfWeekFormatter: PropTypes.func,
87
87
  /**
@@ -107,7 +107,8 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
107
107
  */
108
108
  disableAutoMonthSwitching: PropTypes.bool,
109
109
  /**
110
- * If `true`, the picker and text field are disabled.
110
+ * If `true`, the component is disabled.
111
+ * When disabled, the value cannot be changed and no interaction is possible.
111
112
  * @default false
112
113
  */
113
114
  disabled: PropTypes.bool,
@@ -146,7 +147,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
146
147
  */
147
148
  displayWeekNumber: PropTypes.bool,
148
149
  /**
149
- * @default false
150
+ * @default true
150
151
  */
151
152
  enableAccessibleFieldDOMStructure: PropTypes.any,
152
153
  /**
@@ -257,8 +258,7 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
257
258
  onError: PropTypes.func,
258
259
  /**
259
260
  * Callback fired on month change.
260
- * @template TDate
261
- * @param {TDate} month The new month.
261
+ * @param {PickerValidDate} month The new month.
262
262
  */
263
263
  onMonthChange: PropTypes.func,
264
264
  /**
@@ -298,6 +298,11 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
298
298
  * Used when the component position is controlled.
299
299
  */
300
300
  rangePosition: PropTypes.oneOf(['end', 'start']),
301
+ /**
302
+ * If `true`, the component is read-only.
303
+ * When read-only, the value cannot be changed but the user can interact with the interface.
304
+ * @default false
305
+ */
301
306
  readOnly: PropTypes.bool,
302
307
  /**
303
308
  * If `true`, disable heavy animations.
@@ -330,16 +335,14 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePicker.propTypes = {
330
335
  *
331
336
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
332
337
  *
333
- * @template TDate
334
- * @param {TDate} day The date to test.
338
+ * @param {PickerValidDate} day The date to test.
335
339
  * @param {string} position The date to test, 'start' or 'end'.
336
340
  * @returns {boolean} Returns `true` if the date should be disabled.
337
341
  */
338
342
  shouldDisableDate: PropTypes.func,
339
343
  /**
340
344
  * Disable specific time.
341
- * @template TDate
342
- * @param {TDate} value The value to check.
345
+ * @param {PickerValidDate} value The value to check.
343
346
  * @param {TimeView} view The clock type of the timeValue.
344
347
  * @returns {boolean} If `true` the time will be disabled.
345
348
  */
@@ -8,7 +8,7 @@ import composeClasses from '@mui/utils/composeClasses';
8
8
  import useEventCallback from '@mui/utils/useEventCallback';
9
9
  import { TimeIcon, DateRangeIcon, ArrowLeftIcon, ArrowRightIcon } from '@mui/x-date-pickers/icons';
10
10
  import { isDatePickerView } from '@mui/x-date-pickers/internals';
11
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
11
+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
12
12
  import IconButton from '@mui/material/IconButton';
13
13
  import Button from '@mui/material/Button';
14
14
  import { getDateTimeRangePickerTabsUtilityClass } from "./dateTimeRangePickerTabsClasses.js";
@@ -81,7 +81,7 @@ const DateTimeRangePickerTabs = function DateTimeRangePickerTabs(inProps) {
81
81
  className,
82
82
  sx
83
83
  } = props;
84
- const translations = usePickersTranslations();
84
+ const translations = usePickerTranslations();
85
85
  const classes = useUtilityClasses(props);
86
86
  const value = React.useMemo(() => viewToTab(view, rangePosition), [view, rangePosition]);
87
87
  const isPreviousHidden = value === 'start-date';
@@ -9,7 +9,7 @@ import clsx from 'clsx';
9
9
  import { styled, useThemeProps } from '@mui/material/styles';
10
10
  import composeClasses from '@mui/utils/composeClasses';
11
11
  import { useUtils } from '@mui/x-date-pickers/internals';
12
- import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
12
+ import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
13
13
  import { DateTimePickerToolbar } from '@mui/x-date-pickers/DateTimePicker';
14
14
  import { getDateTimeRangePickerToolbarUtilityClass } from "./dateTimeRangePickerToolbarClasses.js";
15
15
  import { calculateRangeChange } from "../internals/utils/date-range-manager.js";
@@ -105,7 +105,7 @@ const DateTimeRangePickerToolbar = /*#__PURE__*/React.forwardRef(function DateTi
105
105
  toolbarFormat,
106
106
  toolbarPlaceholder
107
107
  };
108
- const translations = usePickersTranslations();
108
+ const translations = usePickerTranslations();
109
109
  const ownerState = props;
110
110
  const classes = useUtilityClasses(ownerState);
111
111
  const handleStartRangeViewChange = React.useCallback(newView => {
@@ -183,6 +183,11 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
183
183
  */
184
184
  classes: PropTypes.object,
185
185
  className: PropTypes.string,
186
+ /**
187
+ * If `true`, the component is disabled.
188
+ * When disabled, the value cannot be changed and no interaction is possible.
189
+ * @default false
190
+ */
186
191
  disabled: PropTypes.bool,
187
192
  /**
188
193
  * If `true`, show the toolbar even in desktop mode.
@@ -199,6 +204,11 @@ process.env.NODE_ENV !== "production" ? DateTimeRangePickerToolbar.propTypes = {
199
204
  */
200
205
  onViewChange: PropTypes.func.isRequired,
201
206
  rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
207
+ /**
208
+ * If `true`, the component is read-only.
209
+ * When read-only, the value cannot be changed but the user can interact with the interface.
210
+ * @default false
211
+ */
202
212
  readOnly: PropTypes.bool,
203
213
  /**
204
214
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { useUtils } from '@mui/x-date-pickers/internals';
6
7
  import { extractValidationProps } from '@mui/x-date-pickers/validation';
7
8
  import resolveComponentProps from '@mui/utils/resolveComponentProps';
8
9
  import { refType } from '@mui/utils';
@@ -23,6 +24,8 @@ import { validateDateRange } from "../validation/index.js";
23
24
  * - [DesktopDateRangePicker API](https://mui.com/x/api/date-pickers/desktop-date-range-picker/)
24
25
  */
25
26
  const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDateRangePicker(inProps, ref) {
27
+ const utils = useUtils();
28
+
26
29
  // Props with the default values common to all date time pickers
27
30
  const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiDesktopDateRangePicker');
28
31
  const viewRenderers = _extends({
@@ -30,6 +33,7 @@ const DesktopDateRangePicker = /*#__PURE__*/React.forwardRef(function DesktopDat
30
33
  }, defaultizedProps.viewRenderers);
31
34
  const props = _extends({}, defaultizedProps, {
32
35
  viewRenderers,
36
+ format: utils.formats.keyboardDate,
33
37
  calendars: defaultizedProps.calendars ?? 2,
34
38
  views: ['day'],
35
39
  openTo: 'day',
@@ -85,9 +89,9 @@ DesktopDateRangePicker.propTypes = {
85
89
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
86
90
  /**
87
91
  * Formats the day of week displayed in the calendar header.
88
- * @param {TDate} date The date of the day of week provided by the adapter.
92
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
89
93
  * @returns {string} The name to display.
90
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
94
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
91
95
  */
92
96
  dayOfWeekFormatter: PropTypes.func,
93
97
  /**
@@ -107,7 +111,8 @@ DesktopDateRangePicker.propTypes = {
107
111
  */
108
112
  disableAutoMonthSwitching: PropTypes.bool,
109
113
  /**
110
- * If `true`, the picker and text field are disabled.
114
+ * If `true`, the component is disabled.
115
+ * When disabled, the value cannot be changed and no interaction is possible.
111
116
  * @default false
112
117
  */
113
118
  disabled: PropTypes.bool,
@@ -141,7 +146,7 @@ DesktopDateRangePicker.propTypes = {
141
146
  */
142
147
  displayWeekNumber: PropTypes.bool,
143
148
  /**
144
- * @default false
149
+ * @default true
145
150
  */
146
151
  enableAccessibleFieldDOMStructure: PropTypes.any,
147
152
  /**
@@ -229,8 +234,7 @@ DesktopDateRangePicker.propTypes = {
229
234
  onError: PropTypes.func,
230
235
  /**
231
236
  * Callback fired on month change.
232
- * @template TDate
233
- * @param {TDate} month The new month.
237
+ * @param {PickerValidDate} month The new month.
234
238
  */
235
239
  onMonthChange: PropTypes.func,
236
240
  /**
@@ -258,6 +262,11 @@ DesktopDateRangePicker.propTypes = {
258
262
  * Used when the component position is controlled.
259
263
  */
260
264
  rangePosition: PropTypes.oneOf(['end', 'start']),
265
+ /**
266
+ * If `true`, the component is read-only.
267
+ * When read-only, the value cannot be changed but the user can interact with the interface.
268
+ * @default false
269
+ */
261
270
  readOnly: PropTypes.bool,
262
271
  /**
263
272
  * If `true`, disable heavy animations.
@@ -290,8 +299,7 @@ DesktopDateRangePicker.propTypes = {
290
299
  *
291
300
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
292
301
  *
293
- * @template TDate
294
- * @param {TDate} day The date to test.
302
+ * @param {PickerValidDate} day The date to test.
295
303
  * @param {string} position The date to test, 'start' or 'end'.
296
304
  * @returns {boolean} Returns `true` if the date should be disabled.
297
305
  */
@@ -166,9 +166,9 @@ DesktopDateTimeRangePicker.propTypes = {
166
166
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
167
167
  /**
168
168
  * Formats the day of week displayed in the calendar header.
169
- * @param {TDate} date The date of the day of week provided by the adapter.
169
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
170
170
  * @returns {string} The name to display.
171
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
171
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
172
172
  */
173
173
  dayOfWeekFormatter: PropTypes.func,
174
174
  /**
@@ -188,7 +188,8 @@ DesktopDateTimeRangePicker.propTypes = {
188
188
  */
189
189
  disableAutoMonthSwitching: PropTypes.bool,
190
190
  /**
191
- * If `true`, the picker and text field are disabled.
191
+ * If `true`, the component is disabled.
192
+ * When disabled, the value cannot be changed and no interaction is possible.
192
193
  * @default false
193
194
  */
194
195
  disabled: PropTypes.bool,
@@ -227,7 +228,7 @@ DesktopDateTimeRangePicker.propTypes = {
227
228
  */
228
229
  displayWeekNumber: PropTypes.bool,
229
230
  /**
230
- * @default false
231
+ * @default true
231
232
  */
232
233
  enableAccessibleFieldDOMStructure: PropTypes.any,
233
234
  /**
@@ -338,8 +339,7 @@ DesktopDateTimeRangePicker.propTypes = {
338
339
  onError: PropTypes.func,
339
340
  /**
340
341
  * Callback fired on month change.
341
- * @template TDate
342
- * @param {TDate} month The new month.
342
+ * @param {PickerValidDate} month The new month.
343
343
  */
344
344
  onMonthChange: PropTypes.func,
345
345
  /**
@@ -379,6 +379,11 @@ DesktopDateTimeRangePicker.propTypes = {
379
379
  * Used when the component position is controlled.
380
380
  */
381
381
  rangePosition: PropTypes.oneOf(['end', 'start']),
382
+ /**
383
+ * If `true`, the component is read-only.
384
+ * When read-only, the value cannot be changed but the user can interact with the interface.
385
+ * @default false
386
+ */
382
387
  readOnly: PropTypes.bool,
383
388
  /**
384
389
  * If `true`, disable heavy animations.
@@ -411,16 +416,14 @@ DesktopDateTimeRangePicker.propTypes = {
411
416
  *
412
417
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
413
418
  *
414
- * @template TDate
415
- * @param {TDate} day The date to test.
419
+ * @param {PickerValidDate} day The date to test.
416
420
  * @param {string} position The date to test, 'start' or 'end'.
417
421
  * @returns {boolean} Returns `true` if the date should be disabled.
418
422
  */
419
423
  shouldDisableDate: PropTypes.func,
420
424
  /**
421
425
  * Disable specific time.
422
- * @template TDate
423
- * @param {TDate} value The value to check.
426
+ * @param {PickerValidDate} value The value to check.
424
427
  * @param {TimeView} view The clock type of the timeValue.
425
428
  * @returns {boolean} If `true` the time will be disabled.
426
429
  */
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { useUtils } from '@mui/x-date-pickers/internals';
6
7
  import { extractValidationProps } from '@mui/x-date-pickers/validation';
7
8
  import resolveComponentProps from '@mui/utils/resolveComponentProps';
8
9
  import { refType } from '@mui/utils';
@@ -23,6 +24,8 @@ import { validateDateRange } from "../validation/index.js";
23
24
  * - [MobileDateRangePicker API](https://mui.com/x/api/date-pickers/mobile-date-range-picker/)
24
25
  */
25
26
  const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateRangePicker(inProps, ref) {
27
+ const utils = useUtils();
28
+
26
29
  // Props with the default values common to all date time pickers
27
30
  const defaultizedProps = useDateRangePickerDefaultizedProps(inProps, 'MuiMobileDateRangePicker');
28
31
  const viewRenderers = _extends({
@@ -30,6 +33,7 @@ const MobileDateRangePicker = /*#__PURE__*/React.forwardRef(function MobileDateR
30
33
  }, defaultizedProps.viewRenderers);
31
34
  const props = _extends({}, defaultizedProps, {
32
35
  viewRenderers,
36
+ format: utils.formats.keyboardDate,
33
37
  // Force one calendar on mobile to avoid layout issues
34
38
  calendars: 1,
35
39
  views: ['day'],
@@ -81,9 +85,9 @@ MobileDateRangePicker.propTypes = {
81
85
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
82
86
  /**
83
87
  * Formats the day of week displayed in the calendar header.
84
- * @param {TDate} date The date of the day of week provided by the adapter.
88
+ * @param {PickerValidDate} date The date of the day of week provided by the adapter.
85
89
  * @returns {string} The name to display.
86
- * @default (date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
90
+ * @default (date: PickerValidDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
87
91
  */
88
92
  dayOfWeekFormatter: PropTypes.func,
89
93
  /**
@@ -103,7 +107,8 @@ MobileDateRangePicker.propTypes = {
103
107
  */
104
108
  disableAutoMonthSwitching: PropTypes.bool,
105
109
  /**
106
- * If `true`, the picker and text field are disabled.
110
+ * If `true`, the component is disabled.
111
+ * When disabled, the value cannot be changed and no interaction is possible.
107
112
  * @default false
108
113
  */
109
114
  disabled: PropTypes.bool,
@@ -137,7 +142,7 @@ MobileDateRangePicker.propTypes = {
137
142
  */
138
143
  displayWeekNumber: PropTypes.bool,
139
144
  /**
140
- * @default false
145
+ * @default true
141
146
  */
142
147
  enableAccessibleFieldDOMStructure: PropTypes.any,
143
148
  /**
@@ -225,8 +230,7 @@ MobileDateRangePicker.propTypes = {
225
230
  onError: PropTypes.func,
226
231
  /**
227
232
  * Callback fired on month change.
228
- * @template TDate
229
- * @param {TDate} month The new month.
233
+ * @param {PickerValidDate} month The new month.
230
234
  */
231
235
  onMonthChange: PropTypes.func,
232
236
  /**
@@ -254,6 +258,11 @@ MobileDateRangePicker.propTypes = {
254
258
  * Used when the component position is controlled.
255
259
  */
256
260
  rangePosition: PropTypes.oneOf(['end', 'start']),
261
+ /**
262
+ * If `true`, the component is read-only.
263
+ * When read-only, the value cannot be changed but the user can interact with the interface.
264
+ * @default false
265
+ */
257
266
  readOnly: PropTypes.bool,
258
267
  /**
259
268
  * If `true`, disable heavy animations.
@@ -286,8 +295,7 @@ MobileDateRangePicker.propTypes = {
286
295
  *
287
296
  * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
288
297
  *
289
- * @template TDate
290
- * @param {TDate} day The date to test.
298
+ * @param {PickerValidDate} day The date to test.
291
299
  * @param {string} position The date to test, 'start' or 'end'.
292
300
  * @returns {boolean} Returns `true` if the date should be disabled.
293
301
  */