@mui/x-date-pickers-pro 6.15.0 → 6.16.1

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 (115) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/DateRangeCalendar/DateRangeCalendar.js +6 -2
  3. package/DateRangeCalendar/DateRangeCalendar.types.d.ts +1 -1
  4. package/DateRangePicker/DateRangePicker.js +6 -2
  5. package/DateRangePicker/DateRangePickerToolbar.js +1 -0
  6. package/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -2
  7. package/MobileDateRangePicker/MobileDateRangePicker.js +6 -2
  8. package/MultiInputDateRangeField/MultiInputDateRangeField.js +3 -0
  9. package/MultiInputDateRangeField/MultiInputDateRangeField.types.d.ts +1 -1
  10. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +3 -0
  11. package/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.types.d.ts +1 -1
  12. package/MultiInputTimeRangeField/MultiInputTimeRangeField.types.d.ts +1 -1
  13. package/SingleInputDateRangeField/SingleInputDateRangeField.js +32 -4
  14. package/SingleInputDateRangeField/SingleInputDateRangeField.types.d.ts +3 -3
  15. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +32 -4
  16. package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.types.d.ts +3 -3
  17. package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +29 -4
  18. package/SingleInputTimeRangeField/SingleInputTimeRangeField.types.d.ts +3 -3
  19. package/StaticDateRangePicker/StaticDateRangePicker.js +6 -2
  20. package/index.js +1 -1
  21. package/internals/hooks/useEnrichedRangePickerFieldProps.d.ts +3 -3
  22. package/internals/hooks/useEnrichedRangePickerFieldProps.js +13 -3
  23. package/internals/hooks/useMultiInputRangeField/shared.d.ts +1 -0
  24. package/internals/hooks/useMultiInputRangeField/shared.js +9 -0
  25. package/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +5 -2
  26. package/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +5 -2
  27. package/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +5 -2
  28. package/internals/models/dateRange.d.ts +3 -0
  29. package/internals/models/fields.d.ts +2 -4
  30. package/internals/utils/releaseInfo.js +1 -1
  31. package/legacy/DateRangeCalendar/DateRangeCalendar.js +6 -2
  32. package/legacy/DateRangePicker/DateRangePicker.js +6 -2
  33. package/legacy/DateRangePicker/DateRangePickerToolbar.js +1 -0
  34. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -2
  35. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +6 -2
  36. package/legacy/MultiInputDateRangeField/MultiInputDateRangeField.js +3 -0
  37. package/legacy/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +3 -0
  38. package/legacy/SingleInputDateRangeField/SingleInputDateRangeField.js +30 -3
  39. package/legacy/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +30 -3
  40. package/legacy/SingleInputTimeRangeField/SingleInputTimeRangeField.js +27 -3
  41. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +6 -2
  42. package/legacy/index.js +1 -1
  43. package/legacy/internals/hooks/useEnrichedRangePickerFieldProps.js +15 -3
  44. package/legacy/internals/hooks/useMultiInputRangeField/shared.js +9 -0
  45. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +5 -2
  46. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +5 -2
  47. package/legacy/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +5 -2
  48. package/legacy/internals/utils/releaseInfo.js +1 -1
  49. package/modern/DateRangeCalendar/DateRangeCalendar.js +6 -2
  50. package/modern/DateRangePicker/DateRangePicker.js +6 -2
  51. package/modern/DateRangePicker/DateRangePickerToolbar.js +1 -0
  52. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +6 -2
  53. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +6 -2
  54. package/modern/MultiInputDateRangeField/MultiInputDateRangeField.js +3 -0
  55. package/modern/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +3 -0
  56. package/modern/SingleInputDateRangeField/SingleInputDateRangeField.js +32 -4
  57. package/modern/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +32 -4
  58. package/modern/SingleInputTimeRangeField/SingleInputTimeRangeField.js +29 -4
  59. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +6 -2
  60. package/modern/index.js +1 -1
  61. package/modern/internals/hooks/useEnrichedRangePickerFieldProps.js +13 -3
  62. package/modern/internals/hooks/useMultiInputRangeField/shared.js +9 -0
  63. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +5 -2
  64. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +5 -2
  65. package/modern/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +5 -2
  66. package/modern/internals/utils/releaseInfo.js +1 -1
  67. package/node/DateRangeCalendar/DateRangeCalendar.js +7 -4
  68. package/node/DateRangeCalendar/dateRangeCalendarClasses.js +1 -2
  69. package/node/DateRangePicker/DateRangePicker.js +7 -4
  70. package/node/DateRangePicker/DateRangePickerToolbar.js +2 -2
  71. package/node/DateRangePicker/dateRangePickerToolbarClasses.js +1 -2
  72. package/node/DateRangePickerDay/DateRangePickerDay.js +1 -2
  73. package/node/DateRangePickerDay/dateRangePickerDayClasses.js +1 -2
  74. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +7 -4
  75. package/node/MobileDateRangePicker/MobileDateRangePicker.js +7 -4
  76. package/node/MultiInputDateRangeField/MultiInputDateRangeField.js +5 -4
  77. package/node/MultiInputDateTimeRangeField/MultiInputDateTimeRangeField.js +5 -4
  78. package/node/MultiInputTimeRangeField/MultiInputTimeRangeField.js +2 -4
  79. package/node/SingleInputDateRangeField/SingleInputDateRangeField.js +33 -6
  80. package/node/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +33 -6
  81. package/node/SingleInputTimeRangeField/SingleInputTimeRangeField.js +30 -6
  82. package/node/StaticDateRangePicker/StaticDateRangePicker.js +7 -4
  83. package/node/index.js +1 -1
  84. package/node/internals/hooks/useEnrichedRangePickerFieldProps.js +13 -3
  85. package/node/internals/hooks/useMultiInputRangeField/shared.js +16 -0
  86. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateRangeField.js +5 -2
  87. package/node/internals/hooks/useMultiInputRangeField/useMultiInputDateTimeRangeField.js +5 -2
  88. package/node/internals/hooks/useMultiInputRangeField/useMultiInputTimeRangeField.js +5 -2
  89. package/node/internals/utils/releaseInfo.js +1 -1
  90. package/node/internals/utils/valueManagers.js +3 -5
  91. package/package.json +5 -5
  92. package/legacy/tests/describeRangeValidation/describeRangeValidation.js +0 -29
  93. package/legacy/tests/describeRangeValidation/describeRangeValidation.types.js +0 -1
  94. package/legacy/tests/describeRangeValidation/index.js +0 -1
  95. package/legacy/tests/describeRangeValidation/testDayViewRangeValidation.js +0 -144
  96. package/legacy/tests/describeRangeValidation/testTextFieldKeyboardRangeValidation.js +0 -291
  97. package/legacy/tests/describeRangeValidation/testTextFieldRangeValidation.js +0 -518
  98. package/modern/tests/describeRangeValidation/describeRangeValidation.js +0 -29
  99. package/modern/tests/describeRangeValidation/describeRangeValidation.types.js +0 -1
  100. package/modern/tests/describeRangeValidation/index.js +0 -1
  101. package/modern/tests/describeRangeValidation/testDayViewRangeValidation.js +0 -145
  102. package/modern/tests/describeRangeValidation/testTextFieldKeyboardRangeValidation.js +0 -285
  103. package/modern/tests/describeRangeValidation/testTextFieldRangeValidation.js +0 -520
  104. package/node/tests/describeRangeValidation/describeRangeValidation.js +0 -37
  105. package/node/tests/describeRangeValidation/describeRangeValidation.types.js +0 -5
  106. package/node/tests/describeRangeValidation/index.js +0 -12
  107. package/node/tests/describeRangeValidation/testDayViewRangeValidation.js +0 -154
  108. package/node/tests/describeRangeValidation/testTextFieldKeyboardRangeValidation.js +0 -294
  109. package/node/tests/describeRangeValidation/testTextFieldRangeValidation.js +0 -530
  110. package/tests/describeRangeValidation/describeRangeValidation.js +0 -29
  111. package/tests/describeRangeValidation/describeRangeValidation.types.js +0 -1
  112. package/tests/describeRangeValidation/index.js +0 -1
  113. package/tests/describeRangeValidation/testDayViewRangeValidation.js +0 -145
  114. package/tests/describeRangeValidation/testTextFieldKeyboardRangeValidation.js +0 -285
  115. package/tests/describeRangeValidation/testTextFieldRangeValidation.js +0 -520
package/CHANGELOG.md CHANGED
@@ -3,6 +3,150 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.16.1
7
+
8
+ _Oct 6, 2023_
9
+
10
+ We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🥧 Support interaction with pie chart
13
+ - 🐞 Bugfixes
14
+ - 📚 Documentation improvements
15
+
16
+ ### Data Grid
17
+
18
+ #### `@mui/x-data-grid@6.16.1`
19
+
20
+ - [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
21
+ - [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
22
+ - [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
23
+
24
+ #### `@mui/x-data-grid-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
25
+
26
+ Same changes as in `@mui/x-data-grid@6.16.1`.
27
+
28
+ #### `@mui/x-data-grid-premium@6.16.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
29
+
30
+ Same changes as in `@mui/x-data-grid-pro@6.16.1`.
31
+
32
+ ### Date Pickers
33
+
34
+ #### `@mui/x-date-pickers@6.16.1`
35
+
36
+ - [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
37
+ - [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
38
+ - [pickers] Improve customization playground examples (#10544) @noraleonte
39
+
40
+ #### `@mui/x-date-pickers-pro@6.16.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
43
+
44
+ - [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
45
+
46
+ ### Charts / `@mui/x-charts@6.0.0-alpha.14`
47
+
48
+ - [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
49
+ - [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
50
+ - [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
51
+
52
+ ### Docs
53
+
54
+ - [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
55
+ - [docs] Add section about disabling columns panel (#10328) @MBilalShafi
56
+ - [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
57
+ - [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
58
+ - [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
59
+
60
+ ### Core
61
+
62
+ - [core] Fix casing consistency with legal and marketing content @oliviertassinari
63
+ - [core] Revert the link in the priority support ticket description (#10517) @michelengelen
64
+ - [CHANGELOG] Polish image @oliviertassinari
65
+
66
+ ## 6.16.0
67
+
68
+ _Sep 29, 2023_
69
+
70
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
71
+
72
+ - 🎁 Add a clearable behavior to all the single input pickers and fields (#9095) @noraleonte
73
+
74
+ The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
75
+
76
+ <img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
77
+
78
+ - 💫 Add Date Picker customization playground (#9581) @noraleonte
79
+
80
+ You can play around with style customization options on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#customization).
81
+
82
+ We are thrilled to hear your feedback about this functionality!
83
+
84
+ - 🚀 Fix header filters menu auto closing on render (#10483) @MBilalShafi
85
+ - 🎯 Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
86
+ - 🌍 Improve Russian (ru-RU) locale on the data grid
87
+ - 🐞 Bugfixes
88
+ - 📚 Documentation improvements
89
+
90
+ ### Data Grid
91
+
92
+ #### `@mui/x-data-grid@6.16.0`
93
+
94
+ - [DataGrid] Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
95
+ - [DataGrid] Rename `global` to `globalScope` due to Jest issue (#10470) @romgrk
96
+ - [l10n] Improve Russian (ru-RU) locale (#10464 and #10407) @NKodos
97
+
98
+ #### `@mui/x-data-grid-pro@6.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
99
+
100
+ Same changes as in `@mui/x-data-grid@6.16.0`, plus:
101
+
102
+ - [DataGridPro] Fix header filters menu auto closing on render (#10483) @MBilalShafi
103
+
104
+ #### `@mui/x-data-grid-premium@6.16.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
105
+
106
+ Same changes as in `@mui/x-data-grid-pro@6.16.0`.
107
+
108
+ ### Date Pickers
109
+
110
+ #### `@mui/x-date-pickers@6.16.0`
111
+
112
+ - [pickers] Add warning to `shouldDisableDate` validation (#10502) @michelengelen
113
+ - [pickers] Implement `clearable` field behavior (#9095) @noraleonte
114
+ - [pickers] Refactor `dayOfWeekFormatter` (#10345) @michelengelen
115
+
116
+ #### `@mui/x-date-pickers-pro@6.16.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
117
+
118
+ Same changes as in `@mui/x-date-pickers@6.16.0`.
119
+
120
+ ### Charts / `@mui/x-charts@6.0.0-alpha.13`
121
+
122
+ - [charts] Share upfront future Pro features (#10465) @oliviertassinari
123
+
124
+ ### Tree View / `@mui/x-tree-view@6.0.0-beta.0`
125
+
126
+ - [TreeView] Do not try to focus a collapsed node when re-focusing the TreeView (#10422) @flaviendelangle
127
+ - [TreeView] Fix the typing of the `Multiple` generic (#10478) @flaviendelangle
128
+
129
+ ### Docs
130
+
131
+ - [docs] Correct the typo in data grid api docs (#10477) @MBilalShafi
132
+ - [docs] Add customization playground (#9581) @noraleonte
133
+ - [docs] Fix Tree View product ID (#10428) @oliviertassinari
134
+ - [docs] Fix demo crashing when all rows are deleted (#10438) @cherniavskii
135
+ - [docs] Fix mobile scrollbar column resize (#10455) @oliviertassinari
136
+ - [docs] Fix usage of `GridRenderCellParams` interface (#10435) @cherniavskii
137
+
138
+ ### Core
139
+
140
+ - [core] Fix typo in header data grid quick filter @oliviertassinari
141
+ - [core] Group D3 renovate PRs (#10480) @flaviendelangle
142
+ - [core] Link the priority support page (#10495) @michelengelen
143
+ - [core] Move the pickers describes to the test utils folder (#10490) @flaviendelangle
144
+ - [core] Priority Support casing normalization @oliviertassinari
145
+ - [core] Remove automated DataGrid performance tests (#10414) @romgrk
146
+ - [core] Sync `prism-okaidia.css` with docs-infra @oliviertassinari
147
+ - [core] Update issue actions & templates (#10375) @romgrk
148
+ - [core] Update release guide (#10468) @DanailH
149
+
6
150
  ## 6.15.0
7
151
 
8
152
  _Sep 22, 2023_
@@ -509,9 +509,10 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
509
509
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
510
510
  /**
511
511
  * Formats the day of week displayed in the calendar header.
512
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
512
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
513
+ * @param {TDate} date The date of the day of week provided by the adapter.
513
514
  * @returns {string} The name to display.
514
- * @default (day) => day.charAt(0).toUpperCase()
515
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
515
516
  */
516
517
  dayOfWeekFormatter: PropTypes.func,
517
518
  /**
@@ -629,6 +630,9 @@ process.env.NODE_ENV !== "production" ? DateRangeCalendar.propTypes = {
629
630
  renderLoading: PropTypes.func,
630
631
  /**
631
632
  * Disable specific date.
633
+ *
634
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
635
+ *
632
636
  * @template TDate
633
637
  * @param {TDate} day The date to test.
634
638
  * @param {string} position The date to test, 'start' or 'end'.
@@ -24,7 +24,7 @@ export interface DateRangeCalendarSlotsComponentsProps<TDate> extends PickersArr
24
24
  selected: boolean;
25
25
  }>;
26
26
  }
27
- export interface ExportedDateRangeCalendarProps<TDate> extends ExportedDayCalendarProps, BaseDateValidationProps<TDate>, DayRangeValidationProps<TDate>, TimezoneProps, Pick<ExportedUseViewsOptions<'day'>, 'autoFocus'> {
27
+ export interface ExportedDateRangeCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, BaseDateValidationProps<TDate>, DayRangeValidationProps<TDate>, TimezoneProps, Pick<ExportedUseViewsOptions<'day'>, 'autoFocus'> {
28
28
  /**
29
29
  * If `true`, after selecting `start` date calendar will not automatically switch to the month of `end` date.
30
30
  * @default false
@@ -77,9 +77,10 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
77
77
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
78
78
  /**
79
79
  * Formats the day of week displayed in the calendar header.
80
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
80
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
81
+ * @param {TDate} date The date of the day of week provided by the adapter.
81
82
  * @returns {string} The name to display.
82
- * @default (day) => day.charAt(0).toUpperCase()
83
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
83
84
  */
84
85
  dayOfWeekFormatter: PropTypes.func,
85
86
  /**
@@ -280,6 +281,9 @@ process.env.NODE_ENV !== "production" ? DateRangePicker.propTypes = {
280
281
  })]),
281
282
  /**
282
283
  * Disable specific date.
284
+ *
285
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
286
+ *
283
287
  * @template TDate
284
288
  * @param {TDate} day The date to test.
285
289
  * @param {string} position The date to test, 'start' or 'end'.
@@ -96,6 +96,7 @@ process.env.NODE_ENV !== "production" ? DateRangePickerToolbar.propTypes = {
96
96
  onRangePositionChange: PropTypes.func.isRequired,
97
97
  rangePosition: PropTypes.oneOf(['end', 'start']).isRequired,
98
98
  readOnly: PropTypes.bool,
99
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
99
100
  titleId: PropTypes.string,
100
101
  /**
101
102
  * Toolbar date format.
@@ -92,9 +92,10 @@ DesktopDateRangePicker.propTypes = {
92
92
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
93
93
  /**
94
94
  * Formats the day of week displayed in the calendar header.
95
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
95
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
96
+ * @param {TDate} date The date of the day of week provided by the adapter.
96
97
  * @returns {string} The name to display.
97
- * @default (day) => day.charAt(0).toUpperCase()
98
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
98
99
  */
99
100
  dayOfWeekFormatter: PropTypes.func,
100
101
  /**
@@ -289,6 +290,9 @@ DesktopDateRangePicker.propTypes = {
289
290
  })]),
290
291
  /**
291
292
  * Disable specific date.
293
+ *
294
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
295
+ *
292
296
  * @template TDate
293
297
  * @param {TDate} day The date to test.
294
298
  * @param {string} position The date to test, 'start' or 'end'.
@@ -92,9 +92,10 @@ MobileDateRangePicker.propTypes = {
92
92
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
93
93
  /**
94
94
  * Formats the day of week displayed in the calendar header.
95
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
95
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
96
+ * @param {TDate} date The date of the day of week provided by the adapter.
96
97
  * @returns {string} The name to display.
97
- * @default (day) => day.charAt(0).toUpperCase()
98
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
98
99
  */
99
100
  dayOfWeekFormatter: PropTypes.func,
100
101
  /**
@@ -289,6 +290,9 @@ MobileDateRangePicker.propTypes = {
289
290
  })]),
290
291
  /**
291
292
  * Disable specific date.
293
+ *
294
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
295
+ *
292
296
  * @template TDate
293
297
  * @param {TDate} day The date to test.
294
298
  * @param {string} position The date to test, 'start' or 'end'.
@@ -283,6 +283,9 @@ process.env.NODE_ENV !== "production" ? MultiInputDateRangeField.propTypes = {
283
283
  })]),
284
284
  /**
285
285
  * Disable specific date.
286
+ *
287
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
288
+ *
286
289
  * @template TDate
287
290
  * @param {TDate} day The date to test.
288
291
  * @param {string} position The date to test, 'start' or 'end'.
@@ -11,7 +11,7 @@ import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputR
11
11
  import { RangeFieldSection } from '../internals/models/fields';
12
12
  import { MultiInputRangeFieldClasses } from '../models';
13
13
  export type UseMultiInputDateRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateRangeFieldProps<TDate>, TTextFieldSlotProps>;
14
- export interface UseMultiInputDateRangeFieldProps<TDate> extends Omit<UseDateRangeFieldProps<TDate>, 'unstableFieldRef'> {
14
+ export interface UseMultiInputDateRangeFieldProps<TDate> extends Omit<UseDateRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
15
15
  unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
16
16
  unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
17
17
  }
@@ -324,6 +324,9 @@ process.env.NODE_ENV !== "production" ? MultiInputDateTimeRangeField.propTypes =
324
324
  shouldDisableClock: PropTypes.func,
325
325
  /**
326
326
  * Disable specific date.
327
+ *
328
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
329
+ *
327
330
  * @template TDate
328
331
  * @param {TDate} day The date to test.
329
332
  * @param {string} position The date to test, 'start' or 'end'.
@@ -11,7 +11,7 @@ import { RangeFieldSection } from '../internals/models/fields';
11
11
  import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputRangeField/useMultiInputRangeField.types';
12
12
  import { MultiInputRangeFieldClasses } from '../models';
13
13
  export type UseMultiInputDateTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputDateTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
14
- export interface UseMultiInputDateTimeRangeFieldProps<TDate> extends Omit<UseDateTimeRangeFieldProps<TDate>, 'unstableFieldRef'> {
14
+ export interface UseMultiInputDateTimeRangeFieldProps<TDate> extends Omit<UseDateTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
15
15
  unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
16
16
  unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
17
17
  }
@@ -11,7 +11,7 @@ import { UseMultiInputRangeFieldParams } from '../internals/hooks/useMultiInputR
11
11
  import { RangeFieldSection } from '../internals/models/fields';
12
12
  import { MultiInputRangeFieldClasses } from '../models';
13
13
  export type UseMultiInputTimeRangeFieldParams<TDate, TTextFieldSlotProps extends {}> = UseMultiInputRangeFieldParams<UseMultiInputTimeRangeFieldProps<TDate>, TTextFieldSlotProps>;
14
- export interface UseMultiInputTimeRangeFieldProps<TDate> extends Omit<UseTimeRangeFieldProps<TDate>, 'unstableFieldRef'> {
14
+ export interface UseMultiInputTimeRangeFieldProps<TDate> extends Omit<UseTimeRangeFieldProps<TDate>, 'unstableFieldRef' | 'clearable' | 'onClear'> {
15
15
  unstableStartFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
16
16
  unstableEndFieldRef?: React.Ref<FieldRef<RangeFieldSection>>;
17
17
  }
@@ -2,12 +2,13 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
4
4
  _excluded2 = ["inputRef"],
5
- _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly"];
5
+ _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
+ import { useClearableField } from '@mui/x-date-pickers/hooks';
11
12
  import { refType } from '@mui/utils';
12
13
  import { useSingleInputDateRangeField } from './useSingleInputDateRangeField';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -51,13 +52,28 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
51
52
  onPaste,
52
53
  onKeyDown,
53
54
  inputMode,
54
- readOnly
55
+ readOnly,
56
+ clearable,
57
+ onClear
55
58
  } = _useSingleInputDateRa,
56
59
  fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateRa, _excluded3);
60
+ const {
61
+ InputProps: ProcessedInputProps,
62
+ fieldProps: processedFieldProps
63
+ } = useClearableField({
64
+ onClear,
65
+ clearable,
66
+ fieldProps,
67
+ InputProps: fieldProps.InputProps,
68
+ slots,
69
+ slotProps,
70
+ components,
71
+ componentsProps
72
+ });
57
73
  return /*#__PURE__*/_jsx(TextField, _extends({
58
74
  ref: ref
59
- }, fieldProps, {
60
- InputProps: _extends({}, fieldProps.InputProps, {
75
+ }, processedFieldProps, {
76
+ InputProps: _extends({}, ProcessedInputProps, {
61
77
  readOnly
62
78
  }),
63
79
  inputProps: _extends({}, fieldProps.inputProps, {
@@ -80,6 +96,11 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
80
96
  */
81
97
  autoFocus: PropTypes.bool,
82
98
  className: PropTypes.string,
99
+ /**
100
+ * If `true`, a clear button will be shown in the field allowing value clearing.
101
+ * @default false
102
+ */
103
+ clearable: PropTypes.bool,
83
104
  /**
84
105
  * The color of the component.
85
106
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -208,6 +229,10 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
208
229
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
209
230
  */
210
231
  onChange: PropTypes.func,
232
+ /**
233
+ * Callback fired when the clear button is clicked.
234
+ */
235
+ onClear: PropTypes.func,
211
236
  /**
212
237
  * Callback fired when the error associated to the current value changes.
213
238
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -254,6 +279,9 @@ process.env.NODE_ENV !== "production" ? SingleInputDateRangeField.propTypes = {
254
279
  })]),
255
280
  /**
256
281
  * Disable specific date.
282
+ *
283
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
284
+ *
257
285
  * @template TDate
258
286
  * @param {TDate} day The date to test.
259
287
  * @param {string} position The date to test, 'start' or 'end'.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField from '@mui/material/TextField';
4
- import { FieldsTextFieldProps, UncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
4
+ import { FieldsTextFieldProps, UncapitalizeObjectKeys, FieldSlotsComponents, FieldSlotsComponentsProps } from '@mui/x-date-pickers/internals';
5
5
  import { UseDateRangeFieldDefaultizedProps, UseDateRangeFieldProps } from '../internals/models';
6
6
  export interface UseSingleInputDateRangeFieldParams<TDate, TChildProps extends {}> {
7
7
  props: UseSingleInputDateRangeFieldComponentProps<TDate, TChildProps>;
@@ -36,7 +36,7 @@ export type SingleInputDateRangeFieldProps<TDate, TChildProps extends {} = Field
36
36
  slotProps?: SingleInputDateRangeFieldSlotsComponentsProps<TDate>;
37
37
  };
38
38
  export type SingleInputDateRangeFieldOwnerState<TDate> = SingleInputDateRangeFieldProps<TDate>;
39
- export interface SingleInputDateRangeFieldSlotsComponent {
39
+ export interface SingleInputDateRangeFieldSlotsComponent extends FieldSlotsComponents {
40
40
  /**
41
41
  * Form control with an input to render the value.
42
42
  * Receives the same props as `@mui/material/TextField`.
@@ -44,6 +44,6 @@ export interface SingleInputDateRangeFieldSlotsComponent {
44
44
  */
45
45
  TextField?: React.ElementType;
46
46
  }
47
- export interface SingleInputDateRangeFieldSlotsComponentsProps<TDate> {
47
+ export interface SingleInputDateRangeFieldSlotsComponentsProps<TDate> extends FieldSlotsComponentsProps {
48
48
  textField?: SlotComponentProps<typeof TextField, {}, SingleInputDateRangeFieldOwnerState<TDate>>;
49
49
  }
@@ -2,12 +2,13 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
4
4
  _excluded2 = ["inputRef"],
5
- _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly"];
5
+ _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import MuiTextField from '@mui/material/TextField';
9
9
  import { useThemeProps } from '@mui/material/styles';
10
10
  import { useSlotProps } from '@mui/base/utils';
11
+ import { useClearableField } from '@mui/x-date-pickers/hooks';
11
12
  import { refType } from '@mui/utils';
12
13
  import { useSingleInputDateTimeRangeField } from './useSingleInputDateTimeRangeField';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -51,13 +52,28 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
51
52
  onPaste,
52
53
  onKeyDown,
53
54
  inputMode,
54
- readOnly
55
+ readOnly,
56
+ clearable,
57
+ onClear
55
58
  } = _useSingleInputDateTi,
56
59
  fieldProps = _objectWithoutPropertiesLoose(_useSingleInputDateTi, _excluded3);
60
+ const {
61
+ InputProps: ProcessedInputProps,
62
+ fieldProps: processedFieldProps
63
+ } = useClearableField({
64
+ onClear,
65
+ clearable,
66
+ fieldProps,
67
+ InputProps: fieldProps.InputProps,
68
+ slots,
69
+ slotProps,
70
+ components,
71
+ componentsProps
72
+ });
57
73
  return /*#__PURE__*/_jsx(TextField, _extends({
58
74
  ref: ref
59
- }, fieldProps, {
60
- InputProps: _extends({}, fieldProps.InputProps, {
75
+ }, processedFieldProps, {
76
+ InputProps: _extends({}, ProcessedInputProps, {
61
77
  readOnly
62
78
  }),
63
79
  inputProps: _extends({}, fieldProps.inputProps, {
@@ -85,6 +101,11 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
85
101
  */
86
102
  autoFocus: PropTypes.bool,
87
103
  className: PropTypes.string,
104
+ /**
105
+ * If `true`, a clear button will be shown in the field allowing value clearing.
106
+ * @default false
107
+ */
108
+ clearable: PropTypes.bool,
88
109
  /**
89
110
  * The color of the component.
90
111
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -241,6 +262,10 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
241
262
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
242
263
  */
243
264
  onChange: PropTypes.func,
265
+ /**
266
+ * Callback fired when the clear button is clicked.
267
+ */
268
+ onClear: PropTypes.func,
244
269
  /**
245
270
  * Callback fired when the error associated to the current value changes.
246
271
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -295,6 +320,9 @@ process.env.NODE_ENV !== "production" ? SingleInputDateTimeRangeField.propTypes
295
320
  shouldDisableClock: PropTypes.func,
296
321
  /**
297
322
  * Disable specific date.
323
+ *
324
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
325
+ *
298
326
  * @template TDate
299
327
  * @param {TDate} day The date to test.
300
328
  * @param {string} position The date to test, 'start' or 'end'.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals/models/fields';
5
- import { UncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
5
+ import { UncapitalizeObjectKeys, FieldSlotsComponents, FieldSlotsComponentsProps } from '@mui/x-date-pickers/internals';
6
6
  import { UseDateTimeRangeFieldDefaultizedProps, UseDateTimeRangeFieldProps } from '../internals/models';
7
7
  export interface UseSingleInputDateTimeRangeFieldParams<TDate, TChildProps extends {}> {
8
8
  props: UseSingleInputDateTimeRangeFieldComponentProps<TDate, TChildProps>;
@@ -37,7 +37,7 @@ export interface SingleInputDateTimeRangeFieldProps<TDate> extends UseSingleInpu
37
37
  slotProps?: SingleInputDateTimeRangeFieldSlotsComponentsProps<TDate>;
38
38
  }
39
39
  export type SingleInputDateTimeRangeFieldOwnerState<TDate> = SingleInputDateTimeRangeFieldProps<TDate>;
40
- export interface SingleInputDateTimeRangeFieldSlotsComponent {
40
+ export interface SingleInputDateTimeRangeFieldSlotsComponent extends FieldSlotsComponents {
41
41
  /**
42
42
  * Form control with an input to render the value.
43
43
  * Receives the same props as `@mui/material/TextField`.
@@ -45,6 +45,6 @@ export interface SingleInputDateTimeRangeFieldSlotsComponent {
45
45
  */
46
46
  TextField?: React.ElementType;
47
47
  }
48
- export interface SingleInputDateTimeRangeFieldSlotsComponentsProps<TDate> {
48
+ export interface SingleInputDateTimeRangeFieldSlotsComponentsProps<TDate> extends FieldSlotsComponentsProps {
49
49
  textField?: SlotComponentProps<typeof TextField, {}, SingleInputDateTimeRangeFieldOwnerState<TDate>>;
50
50
  }
@@ -2,9 +2,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["slots", "slotProps", "components", "componentsProps", "InputProps", "inputProps"],
4
4
  _excluded2 = ["inputRef"],
5
- _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly"];
5
+ _excluded3 = ["ref", "onPaste", "onKeyDown", "inputMode", "readOnly", "clearable", "onClear"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import { useClearableField } from '@mui/x-date-pickers/hooks';
8
9
  import MuiTextField from '@mui/material/TextField';
9
10
  import { useThemeProps } from '@mui/material/styles';
10
11
  import { useSlotProps } from '@mui/base/utils';
@@ -51,13 +52,28 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
51
52
  onPaste,
52
53
  onKeyDown,
53
54
  inputMode,
54
- readOnly
55
+ readOnly,
56
+ clearable,
57
+ onClear
55
58
  } = _useSingleInputTimeRa,
56
59
  fieldProps = _objectWithoutPropertiesLoose(_useSingleInputTimeRa, _excluded3);
60
+ const {
61
+ InputProps: ProcessedInputProps,
62
+ fieldProps: processedFieldProps
63
+ } = useClearableField({
64
+ onClear,
65
+ clearable,
66
+ fieldProps,
67
+ InputProps: fieldProps.InputProps,
68
+ slots,
69
+ slotProps,
70
+ components,
71
+ componentsProps
72
+ });
57
73
  return /*#__PURE__*/_jsx(TextField, _extends({
58
74
  ref: ref
59
- }, fieldProps, {
60
- InputProps: _extends({}, fieldProps.InputProps, {
75
+ }, processedFieldProps, {
76
+ InputProps: _extends({}, ProcessedInputProps, {
61
77
  readOnly
62
78
  }),
63
79
  inputProps: _extends({}, fieldProps.inputProps, {
@@ -85,6 +101,11 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
85
101
  */
86
102
  autoFocus: PropTypes.bool,
87
103
  className: PropTypes.string,
104
+ /**
105
+ * If `true`, a clear button will be shown in the field allowing value clearing.
106
+ * @default false
107
+ */
108
+ clearable: PropTypes.bool,
88
109
  /**
89
110
  * The color of the component.
90
111
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -225,6 +246,10 @@ process.env.NODE_ENV !== "production" ? SingleInputTimeRangeField.propTypes = {
225
246
  * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
226
247
  */
227
248
  onChange: PropTypes.func,
249
+ /**
250
+ * Callback fired when the clear button is clicked.
251
+ */
252
+ onClear: PropTypes.func,
228
253
  /**
229
254
  * Callback fired when the error associated to the current value changes.
230
255
  * @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base/utils';
3
3
  import TextField from '@mui/material/TextField';
4
4
  import { FieldsTextFieldProps } from '@mui/x-date-pickers/internals/models/fields';
5
- import { UncapitalizeObjectKeys } from '@mui/x-date-pickers/internals';
5
+ import { UncapitalizeObjectKeys, FieldSlotsComponents, FieldSlotsComponentsProps } from '@mui/x-date-pickers/internals';
6
6
  import { UseTimeRangeFieldDefaultizedProps, UseTimeRangeFieldProps } from '../internals/models';
7
7
  export interface UseSingleInputTimeRangeFieldParams<TDate, TChildProps extends {}> {
8
8
  props: UseSingleInputTimeRangeFieldComponentProps<TDate, TChildProps>;
@@ -37,7 +37,7 @@ export interface SingleInputTimeRangeFieldProps<TDate> extends UseSingleInputTim
37
37
  slotProps?: SingleInputTimeRangeFieldSlotsComponentsProps<TDate>;
38
38
  }
39
39
  export type SingleInputTimeRangeFieldOwnerState<TDate> = SingleInputTimeRangeFieldProps<TDate>;
40
- export interface SingleInputTimeRangeFieldSlotsComponent {
40
+ export interface SingleInputTimeRangeFieldSlotsComponent extends FieldSlotsComponents {
41
41
  /**
42
42
  * Form control with an input to render the value.
43
43
  * Receives the same props as `@mui/material/TextField`.
@@ -45,6 +45,6 @@ export interface SingleInputTimeRangeFieldSlotsComponent {
45
45
  */
46
46
  TextField?: React.ElementType;
47
47
  }
48
- export interface SingleInputTimeRangeFieldSlotsComponentsProps<TDate> {
48
+ export interface SingleInputTimeRangeFieldSlotsComponentsProps<TDate> extends FieldSlotsComponentsProps {
49
49
  textField?: SlotComponentProps<typeof TextField, {}, SingleInputTimeRangeFieldOwnerState<TDate>>;
50
50
  }
@@ -78,9 +78,10 @@ StaticDateRangePicker.propTypes = {
78
78
  currentMonthCalendarPosition: PropTypes.oneOf([1, 2, 3]),
79
79
  /**
80
80
  * Formats the day of week displayed in the calendar header.
81
- * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
81
+ * @param {string} day The day of week provided by the adapter. Deprecated, will be removed in v7: Use `date` instead.
82
+ * @param {TDate} date The date of the day of week provided by the adapter.
82
83
  * @returns {string} The name to display.
83
- * @default (day) => day.charAt(0).toUpperCase()
84
+ * @default (_day: string, date: TDate) => adapter.format(date, 'weekdayShort').charAt(0).toUpperCase()
84
85
  */
85
86
  dayOfWeekFormatter: PropTypes.func,
86
87
  /**
@@ -227,6 +228,9 @@ StaticDateRangePicker.propTypes = {
227
228
  renderLoading: PropTypes.func,
228
229
  /**
229
230
  * Disable specific date.
231
+ *
232
+ * Warning: This function can be called multiple times (e.g. when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance.
233
+ *
230
234
  * @template TDate
231
235
  * @param {TDate} day The date to test.
232
236
  * @param {string} position The date to test, 'start' or 'end'.