@mui/x-date-pickers 8.5.3 → 8.7.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.
- package/CHANGELOG.md +210 -0
- package/DateCalendar/DateCalendar.js +16 -16
- package/DateCalendar/DayCalendar.js +48 -48
- package/DateCalendar/useCalendarState.js +25 -25
- package/DateCalendar/useIsDateDisabled.js +2 -2
- package/DatePicker/DatePickerToolbar.js +7 -9
- package/DateTimeField/DateTimeField.js +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePickerToolbar.js +12 -13
- package/DateTimePicker/shared.js +3 -3
- package/DesktopDatePicker/DesktopDatePicker.js +3 -3
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -4
- package/DesktopTimePicker/DesktopTimePicker.js +4 -4
- package/DigitalClock/DigitalClock.d.ts +1 -1
- package/DigitalClock/DigitalClock.js +16 -16
- package/LocalizationProvider/LocalizationProvider.d.ts +9 -3
- package/LocalizationProvider/LocalizationProvider.js +28 -19
- package/MobileDatePicker/MobileDatePicker.js +3 -3
- package/MobileDateTimePicker/MobileDateTimePicker.js +4 -4
- package/MobileTimePicker/MobileTimePicker.js +4 -4
- package/MonthCalendar/MonthCalendar.js +19 -18
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +32 -32
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +4 -4
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +7 -7
- package/PickerDay2/PickerDay2.js +3 -3
- package/PickersActionBar/PickersActionBar.d.ts +2 -2
- package/PickersActionBar/PickersActionBar.js +2 -2
- package/PickersCalendarHeader/PickersCalendarHeader.js +7 -8
- package/PickersDay/PickersDay.js +3 -3
- package/PickersDay/usePickerDayOwnerState.js +5 -5
- package/PickersTextField/PickersInputBase/PickersInputBase.js +1 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/StaticTimePicker/StaticTimePicker.js +1 -1
- package/TimeClock/Clock.js +8 -9
- package/TimeClock/ClockNumbers.d.ts +3 -3
- package/TimeClock/ClockNumbers.js +5 -5
- package/TimeClock/TimeClock.js +29 -29
- package/TimeField/TimeField.js +1 -1
- package/TimePicker/TimePicker.js +1 -1
- package/TimePicker/TimePickerToolbar.js +7 -9
- package/TimePicker/shared.js +3 -3
- package/YearCalendar/YearCalendar.js +19 -18
- package/esm/DateCalendar/DateCalendar.js +16 -16
- package/esm/DateCalendar/DayCalendar.js +48 -48
- package/esm/DateCalendar/useCalendarState.js +25 -25
- package/esm/DateCalendar/useIsDateDisabled.js +2 -2
- package/esm/DatePicker/DatePickerToolbar.js +6 -8
- package/esm/DateTimeField/DateTimeField.js +1 -1
- package/esm/DateTimePicker/DateTimePicker.js +1 -1
- package/esm/DateTimePicker/DateTimePickerToolbar.js +11 -12
- package/esm/DateTimePicker/shared.js +3 -3
- package/esm/DesktopDatePicker/DesktopDatePicker.js +3 -3
- package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +4 -4
- package/esm/DesktopTimePicker/DesktopTimePicker.js +4 -4
- package/esm/DigitalClock/DigitalClock.d.ts +1 -1
- package/esm/DigitalClock/DigitalClock.js +16 -16
- package/esm/LocalizationProvider/LocalizationProvider.d.ts +9 -3
- package/esm/LocalizationProvider/LocalizationProvider.js +27 -18
- package/esm/MobileDatePicker/MobileDatePicker.js +3 -3
- package/esm/MobileDateTimePicker/MobileDateTimePicker.js +4 -4
- package/esm/MobileTimePicker/MobileTimePicker.js +4 -4
- package/esm/MonthCalendar/MonthCalendar.js +20 -19
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.js +32 -32
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +4 -4
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +7 -7
- package/esm/PickerDay2/PickerDay2.js +3 -3
- package/esm/PickersActionBar/PickersActionBar.d.ts +2 -2
- package/esm/PickersActionBar/PickersActionBar.js +2 -2
- package/esm/PickersCalendarHeader/PickersCalendarHeader.js +6 -7
- package/esm/PickersDay/PickersDay.js +3 -3
- package/esm/PickersDay/usePickerDayOwnerState.js +5 -5
- package/esm/PickersTextField/PickersInputBase/PickersInputBase.js +2 -0
- package/esm/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/esm/StaticTimePicker/StaticTimePicker.js +1 -1
- package/esm/TimeClock/Clock.js +7 -8
- package/esm/TimeClock/ClockNumbers.d.ts +3 -3
- package/esm/TimeClock/ClockNumbers.js +5 -5
- package/esm/TimeClock/TimeClock.js +29 -29
- package/esm/TimeField/TimeField.js +1 -1
- package/esm/TimePicker/TimePicker.js +1 -1
- package/esm/TimePicker/TimePickerToolbar.js +6 -8
- package/esm/TimePicker/shared.js +3 -3
- package/esm/YearCalendar/YearCalendar.js +20 -19
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useParsedFormat.js +6 -6
- package/esm/hooks/usePickerAdapter.d.ts +7 -0
- package/esm/hooks/usePickerAdapter.js +20 -0
- package/esm/hooks/usePickerTranslations.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/components/PickerFieldUI.js +2 -0
- package/esm/internals/components/PickerPopper/PickerPopper.js +2 -0
- package/esm/internals/components/PickerProvider.js +2 -0
- package/esm/internals/components/pickersToolbarClasses.d.ts +1 -1
- package/esm/internals/demo/DemoContainer.d.ts +2 -3
- package/esm/internals/demo/DemoContainer.js +3 -2
- package/esm/internals/hooks/date-helpers-hooks.js +16 -16
- package/esm/internals/hooks/useClockReferenceDate.d.ts +2 -2
- package/esm/internals/hooks/useClockReferenceDate.js +5 -5
- package/esm/internals/hooks/useControlledValue.d.ts +2 -2
- package/esm/internals/hooks/useControlledValue.js +8 -7
- package/esm/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -1
- package/esm/internals/hooks/useField/buildSectionsFromFormat.js +17 -17
- package/esm/internals/hooks/useField/useField.types.d.ts +4 -4
- package/esm/internals/hooks/useField/useField.utils.d.ts +10 -10
- package/esm/internals/hooks/useField/useField.utils.js +69 -69
- package/esm/internals/hooks/useField/useFieldCharacterEditing.js +11 -11
- package/esm/internals/hooks/useField/useFieldRootHandleKeyDown.js +7 -7
- package/esm/internals/hooks/useField/useFieldSectionContentProps.js +15 -16
- package/esm/internals/hooks/useField/useFieldState.js +24 -24
- package/esm/internals/hooks/useField/useFieldV6TextField.js +2 -0
- package/esm/internals/hooks/useField/useFieldV7TextField.js +2 -0
- package/esm/internals/hooks/useNullableFieldPrivateContext.js +2 -0
- package/esm/internals/hooks/usePicker/hooks/useOrientation.js +2 -0
- package/esm/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +8 -6
- package/esm/internals/hooks/usePicker/usePicker.js +7 -6
- package/esm/internals/hooks/usePicker/usePicker.types.d.ts +3 -3
- package/esm/internals/hooks/useUtils.d.ts +1 -8
- package/esm/internals/hooks/useUtils.js +3 -19
- package/esm/internals/hooks/useViews.js +2 -0
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/index.js +2 -1
- package/esm/internals/models/manager.d.ts +17 -17
- package/esm/internals/models/props/time.d.ts +1 -1
- package/esm/internals/utils/date-time-utils.d.ts +1 -1
- package/esm/internals/utils/date-time-utils.js +5 -5
- package/esm/internals/utils/date-utils.d.ts +11 -11
- package/esm/internals/utils/date-utils.js +34 -34
- package/esm/internals/utils/getDefaultReferenceDate.d.ts +2 -2
- package/esm/internals/utils/getDefaultReferenceDate.js +16 -16
- package/esm/internals/utils/time-utils.d.ts +5 -5
- package/esm/internals/utils/time-utils.js +12 -12
- package/esm/internals/utils/valueManagers.js +4 -4
- package/esm/managers/useDateManager.js +12 -12
- package/esm/managers/useDateTimeManager.js +13 -13
- package/esm/managers/useTimeManager.js +9 -10
- package/esm/validation/useValidation.d.ts +2 -3
- package/esm/validation/useValidation.js +2 -2
- package/esm/validation/validateDate.js +6 -6
- package/esm/validation/validateTime.js +6 -6
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +8 -1
- package/hooks/useParsedFormat.js +6 -6
- package/hooks/usePickerAdapter.d.ts +7 -0
- package/hooks/usePickerAdapter.js +29 -0
- package/hooks/usePickerTranslations.js +2 -2
- package/index.js +1 -1
- package/internals/components/PickerFieldUI.js +1 -0
- package/internals/components/PickerPopper/PickerPopper.js +1 -0
- package/internals/components/PickerProvider.js +1 -0
- package/internals/components/pickersToolbarClasses.d.ts +1 -1
- package/internals/demo/DemoContainer.d.ts +2 -3
- package/internals/demo/DemoContainer.js +3 -2
- package/internals/hooks/date-helpers-hooks.js +16 -16
- package/internals/hooks/useClockReferenceDate.d.ts +2 -2
- package/internals/hooks/useClockReferenceDate.js +5 -5
- package/internals/hooks/useControlledValue.d.ts +2 -2
- package/internals/hooks/useControlledValue.js +7 -7
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -1
- package/internals/hooks/useField/buildSectionsFromFormat.js +17 -17
- package/internals/hooks/useField/useField.types.d.ts +4 -4
- package/internals/hooks/useField/useField.utils.d.ts +10 -10
- package/internals/hooks/useField/useField.utils.js +69 -69
- package/internals/hooks/useField/useFieldCharacterEditing.js +11 -11
- package/internals/hooks/useField/useFieldRootHandleKeyDown.js +7 -7
- package/internals/hooks/useField/useFieldSectionContentProps.js +14 -15
- package/internals/hooks/useField/useFieldState.js +24 -25
- package/internals/hooks/useField/useFieldV6TextField.js +1 -0
- package/internals/hooks/useField/useFieldV7TextField.js +1 -0
- package/internals/hooks/useNullableFieldPrivateContext.js +1 -0
- package/internals/hooks/usePicker/hooks/useOrientation.js +1 -0
- package/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +7 -6
- package/internals/hooks/usePicker/usePicker.js +6 -6
- package/internals/hooks/usePicker/usePicker.types.d.ts +3 -3
- package/internals/hooks/useUtils.d.ts +1 -8
- package/internals/hooks/useUtils.js +5 -24
- package/internals/hooks/useViews.js +1 -0
- package/internals/index.d.ts +2 -1
- package/internals/index.js +2 -7
- package/internals/models/manager.d.ts +17 -17
- package/internals/models/props/time.d.ts +1 -1
- package/internals/utils/date-time-utils.d.ts +1 -1
- package/internals/utils/date-time-utils.js +5 -5
- package/internals/utils/date-utils.d.ts +11 -11
- package/internals/utils/date-utils.js +34 -34
- package/internals/utils/getDefaultReferenceDate.d.ts +2 -2
- package/internals/utils/getDefaultReferenceDate.js +16 -16
- package/internals/utils/time-utils.d.ts +5 -5
- package/internals/utils/time-utils.js +12 -12
- package/internals/utils/valueManagers.js +4 -4
- package/managers/useDateManager.js +12 -12
- package/managers/useDateTimeManager.js +13 -13
- package/managers/useTimeManager.js +10 -11
- package/package.json +2 -2
- package/validation/useValidation.d.ts +2 -3
- package/validation/useValidation.js +2 -2
- package/validation/validateDate.js +6 -6
- package/validation/validateTime.js +6 -6
|
@@ -10,8 +10,8 @@ import { useRtl } from '@mui/system/RtlProvider';
|
|
|
10
10
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
11
11
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
12
12
|
import composeClasses from '@mui/utils/composeClasses';
|
|
13
|
-
import { usePickerTranslations } from "../hooks/
|
|
14
|
-
import {
|
|
13
|
+
import { usePickerAdapter, usePickerTranslations } from "../hooks/index.js";
|
|
14
|
+
import { useNow } from "../internals/hooks/useUtils.js";
|
|
15
15
|
import { convertValueToMeridiem, createIsAfterIgnoreDatePart } from "../internals/utils/time-utils.js";
|
|
16
16
|
import { useViews } from "../internals/hooks/useViews.js";
|
|
17
17
|
import { useMeridiemMode } from "../internals/hooks/date-helpers-hooks.js";
|
|
@@ -52,14 +52,14 @@ const MultiSectionDigitalClockRoot = styled(PickerViewRoot, {
|
|
|
52
52
|
* - [MultiSectionDigitalClock API](https://mui.com/x/api/date-pickers/multi-section-digital-clock/)
|
|
53
53
|
*/
|
|
54
54
|
export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function MultiSectionDigitalClock(inProps, ref) {
|
|
55
|
-
const
|
|
55
|
+
const adapter = usePickerAdapter();
|
|
56
56
|
const isRtl = useRtl();
|
|
57
57
|
const props = useThemeProps({
|
|
58
58
|
props: inProps,
|
|
59
59
|
name: 'MuiMultiSectionDigitalClock'
|
|
60
60
|
});
|
|
61
61
|
const {
|
|
62
|
-
ampm =
|
|
62
|
+
ampm = adapter.is12HourCycleInCurrentLocale(),
|
|
63
63
|
timeSteps: inTimeSteps,
|
|
64
64
|
autoFocus,
|
|
65
65
|
slots,
|
|
@@ -112,7 +112,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
112
112
|
const valueOrReferenceDate = useClockReferenceDate({
|
|
113
113
|
value,
|
|
114
114
|
referenceDate: referenceDateProp,
|
|
115
|
-
|
|
115
|
+
adapter,
|
|
116
116
|
props,
|
|
117
117
|
timezone
|
|
118
118
|
});
|
|
@@ -144,7 +144,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
144
144
|
handleMeridiemChange
|
|
145
145
|
} = useMeridiemMode(valueOrReferenceDate, ampm, handleMeridiemValueChange, 'finish');
|
|
146
146
|
const isTimeDisabled = React.useCallback((rawValue, viewType) => {
|
|
147
|
-
const isAfter = createIsAfterIgnoreDatePart(disableIgnoringDatePartForTimeValidation,
|
|
147
|
+
const isAfter = createIsAfterIgnoreDatePart(disableIgnoringDatePartForTimeValidation, adapter);
|
|
148
148
|
const shouldCheckPastEnd = viewType === 'hours' || viewType === 'minutes' && views.includes('seconds');
|
|
149
149
|
const containsValidTime = ({
|
|
150
150
|
start,
|
|
@@ -171,11 +171,11 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
171
171
|
if (shouldDisableTime) {
|
|
172
172
|
switch (viewType) {
|
|
173
173
|
case 'hours':
|
|
174
|
-
return !shouldDisableTime(
|
|
174
|
+
return !shouldDisableTime(adapter.setHours(valueOrReferenceDate, timeValue), 'hours');
|
|
175
175
|
case 'minutes':
|
|
176
|
-
return !shouldDisableTime(
|
|
176
|
+
return !shouldDisableTime(adapter.setMinutes(valueOrReferenceDate, timeValue), 'minutes');
|
|
177
177
|
case 'seconds':
|
|
178
|
-
return !shouldDisableTime(
|
|
178
|
+
return !shouldDisableTime(adapter.setSeconds(valueOrReferenceDate, timeValue), 'seconds');
|
|
179
179
|
default:
|
|
180
180
|
return false;
|
|
181
181
|
}
|
|
@@ -186,12 +186,12 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
186
186
|
case 'hours':
|
|
187
187
|
{
|
|
188
188
|
const valueWithMeridiem = convertValueToMeridiem(rawValue, meridiemMode, ampm);
|
|
189
|
-
const dateWithNewHours =
|
|
190
|
-
if (
|
|
189
|
+
const dateWithNewHours = adapter.setHours(valueOrReferenceDate, valueWithMeridiem);
|
|
190
|
+
if (adapter.getHours(dateWithNewHours) !== valueWithMeridiem) {
|
|
191
191
|
return true;
|
|
192
192
|
}
|
|
193
|
-
const start =
|
|
194
|
-
const end =
|
|
193
|
+
const start = adapter.setSeconds(adapter.setMinutes(dateWithNewHours, 0), 0);
|
|
194
|
+
const end = adapter.setSeconds(adapter.setMinutes(dateWithNewHours, 59), 59);
|
|
195
195
|
return !containsValidTime({
|
|
196
196
|
start,
|
|
197
197
|
end
|
|
@@ -199,9 +199,9 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
199
199
|
}
|
|
200
200
|
case 'minutes':
|
|
201
201
|
{
|
|
202
|
-
const dateWithNewMinutes =
|
|
203
|
-
const start =
|
|
204
|
-
const end =
|
|
202
|
+
const dateWithNewMinutes = adapter.setMinutes(valueOrReferenceDate, rawValue);
|
|
203
|
+
const start = adapter.setSeconds(dateWithNewMinutes, 0);
|
|
204
|
+
const end = adapter.setSeconds(dateWithNewMinutes, 59);
|
|
205
205
|
return !containsValidTime({
|
|
206
206
|
start,
|
|
207
207
|
end
|
|
@@ -209,7 +209,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
209
209
|
}
|
|
210
210
|
case 'seconds':
|
|
211
211
|
{
|
|
212
|
-
const dateWithNewSeconds =
|
|
212
|
+
const dateWithNewSeconds = adapter.setSeconds(valueOrReferenceDate, rawValue);
|
|
213
213
|
const start = dateWithNewSeconds;
|
|
214
214
|
const end = dateWithNewSeconds;
|
|
215
215
|
return !containsValidTime({
|
|
@@ -220,7 +220,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
220
220
|
default:
|
|
221
221
|
throw new Error('not supported');
|
|
222
222
|
}
|
|
223
|
-
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime,
|
|
223
|
+
}, [ampm, valueOrReferenceDate, disableIgnoringDatePartForTimeValidation, maxTime, meridiemMode, minTime, minutesStep, shouldDisableTime, adapter, disableFuture, disablePast, now, views]);
|
|
224
224
|
const buildViewProps = React.useCallback(viewToBuild => {
|
|
225
225
|
switch (viewToBuild) {
|
|
226
226
|
case 'hours':
|
|
@@ -228,13 +228,13 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
228
228
|
return {
|
|
229
229
|
onChange: hours => {
|
|
230
230
|
const valueWithMeridiem = convertValueToMeridiem(hours, meridiemMode, ampm);
|
|
231
|
-
setValueAndGoToNextView(
|
|
231
|
+
setValueAndGoToNextView(adapter.setHours(valueOrReferenceDate, valueWithMeridiem), 'finish', 'hours');
|
|
232
232
|
},
|
|
233
233
|
items: getHourSectionOptions({
|
|
234
234
|
now,
|
|
235
235
|
value,
|
|
236
236
|
ampm,
|
|
237
|
-
|
|
237
|
+
adapter,
|
|
238
238
|
isDisabled: hours => isTimeDisabled(hours, 'hours'),
|
|
239
239
|
timeStep: timeSteps.hours,
|
|
240
240
|
resolveAriaLabel: translations.hoursClockNumberText,
|
|
@@ -246,13 +246,13 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
246
246
|
{
|
|
247
247
|
return {
|
|
248
248
|
onChange: minutes => {
|
|
249
|
-
setValueAndGoToNextView(
|
|
249
|
+
setValueAndGoToNextView(adapter.setMinutes(valueOrReferenceDate, minutes), 'finish', 'minutes');
|
|
250
250
|
},
|
|
251
251
|
items: getTimeSectionOptions({
|
|
252
|
-
value:
|
|
253
|
-
|
|
252
|
+
value: adapter.getMinutes(valueOrReferenceDate),
|
|
253
|
+
adapter,
|
|
254
254
|
isDisabled: minutes => isTimeDisabled(minutes, 'minutes'),
|
|
255
|
-
resolveLabel: minutes =>
|
|
255
|
+
resolveLabel: minutes => adapter.format(adapter.setMinutes(now, minutes), 'minutes'),
|
|
256
256
|
timeStep: timeSteps.minutes,
|
|
257
257
|
hasValue: !!value,
|
|
258
258
|
resolveAriaLabel: translations.minutesClockNumberText
|
|
@@ -263,13 +263,13 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
263
263
|
{
|
|
264
264
|
return {
|
|
265
265
|
onChange: seconds => {
|
|
266
|
-
setValueAndGoToNextView(
|
|
266
|
+
setValueAndGoToNextView(adapter.setSeconds(valueOrReferenceDate, seconds), 'finish', 'seconds');
|
|
267
267
|
},
|
|
268
268
|
items: getTimeSectionOptions({
|
|
269
|
-
value:
|
|
270
|
-
|
|
269
|
+
value: adapter.getSeconds(valueOrReferenceDate),
|
|
270
|
+
adapter,
|
|
271
271
|
isDisabled: seconds => isTimeDisabled(seconds, 'seconds'),
|
|
272
|
-
resolveLabel: seconds =>
|
|
272
|
+
resolveLabel: seconds => adapter.format(adapter.setSeconds(now, seconds), 'seconds'),
|
|
273
273
|
timeStep: timeSteps.seconds,
|
|
274
274
|
hasValue: !!value,
|
|
275
275
|
resolveAriaLabel: translations.secondsClockNumberText
|
|
@@ -278,8 +278,8 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
278
278
|
}
|
|
279
279
|
case 'meridiem':
|
|
280
280
|
{
|
|
281
|
-
const amLabel = formatMeridiem(
|
|
282
|
-
const pmLabel = formatMeridiem(
|
|
281
|
+
const amLabel = formatMeridiem(adapter, 'am');
|
|
282
|
+
const pmLabel = formatMeridiem(adapter, 'pm');
|
|
283
283
|
return {
|
|
284
284
|
onChange: handleMeridiemChange,
|
|
285
285
|
items: [{
|
|
@@ -300,7 +300,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
300
300
|
default:
|
|
301
301
|
throw new Error(`Unknown view: ${viewToBuild} found.`);
|
|
302
302
|
}
|
|
303
|
-
}, [now, value, ampm,
|
|
303
|
+
}, [now, value, ampm, adapter, timeSteps.hours, timeSteps.minutes, timeSteps.seconds, translations.hoursClockNumberText, translations.minutesClockNumberText, translations.secondsClockNumberText, meridiemMode, setValueAndGoToNextView, valueOrReferenceDate, isTimeDisabled, handleMeridiemChange]);
|
|
304
304
|
const viewsToRender = React.useMemo(() => {
|
|
305
305
|
if (!isRtl) {
|
|
306
306
|
return views;
|
|
@@ -351,7 +351,7 @@ process.env.NODE_ENV !== "production" ? MultiSectionDigitalClock.propTypes = {
|
|
|
351
351
|
// ----------------------------------------------------------------------
|
|
352
352
|
/**
|
|
353
353
|
* 12h/24h view for hour selection clock.
|
|
354
|
-
* @default
|
|
354
|
+
* @default adapter.is12HourCycleInCurrentLocale()
|
|
355
355
|
*/
|
|
356
356
|
ampm: PropTypes.bool,
|
|
357
357
|
/**
|
|
@@ -3,7 +3,7 @@ import { MultiSectionDigitalClockOption } from "./MultiSectionDigitalClock.types
|
|
|
3
3
|
interface GetHoursSectionOptionsParameters {
|
|
4
4
|
now: PickerValidDate;
|
|
5
5
|
value: PickerValidDate | null;
|
|
6
|
-
|
|
6
|
+
adapter: MuiPickersAdapter;
|
|
7
7
|
ampm: boolean;
|
|
8
8
|
isDisabled: (value: number) => boolean;
|
|
9
9
|
timeStep: number;
|
|
@@ -13,7 +13,7 @@ interface GetHoursSectionOptionsParameters {
|
|
|
13
13
|
export declare const getHourSectionOptions: ({
|
|
14
14
|
now,
|
|
15
15
|
value,
|
|
16
|
-
|
|
16
|
+
adapter,
|
|
17
17
|
ampm,
|
|
18
18
|
isDisabled,
|
|
19
19
|
resolveAriaLabel,
|
|
@@ -22,7 +22,7 @@ export declare const getHourSectionOptions: ({
|
|
|
22
22
|
}: GetHoursSectionOptionsParameters) => MultiSectionDigitalClockOption<number>[];
|
|
23
23
|
interface GetTimeSectionOptionsParameters {
|
|
24
24
|
value: number | null;
|
|
25
|
-
|
|
25
|
+
adapter: MuiPickersAdapter;
|
|
26
26
|
isDisabled: (value: number) => boolean;
|
|
27
27
|
timeStep: number;
|
|
28
28
|
resolveLabel: (value: number) => string;
|
|
@@ -31,7 +31,7 @@ interface GetTimeSectionOptionsParameters {
|
|
|
31
31
|
}
|
|
32
32
|
export declare const getTimeSectionOptions: ({
|
|
33
33
|
value,
|
|
34
|
-
|
|
34
|
+
adapter,
|
|
35
35
|
isDisabled,
|
|
36
36
|
timeStep,
|
|
37
37
|
resolveLabel,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const getHourSectionOptions = ({
|
|
2
2
|
now,
|
|
3
3
|
value,
|
|
4
|
-
|
|
4
|
+
adapter,
|
|
5
5
|
ampm,
|
|
6
6
|
isDisabled,
|
|
7
7
|
resolveAriaLabel,
|
|
8
8
|
timeStep,
|
|
9
9
|
valueOrReferenceDate
|
|
10
10
|
}) => {
|
|
11
|
-
const currentHours = value ?
|
|
11
|
+
const currentHours = value ? adapter.getHours(value) : null;
|
|
12
12
|
const result = [];
|
|
13
13
|
const isSelected = (hour, overriddenCurrentHours) => {
|
|
14
14
|
const resolvedCurrentHours = overriddenCurrentHours ?? currentHours;
|
|
@@ -24,13 +24,13 @@ export const getHourSectionOptions = ({
|
|
|
24
24
|
return resolvedCurrentHours === hour;
|
|
25
25
|
};
|
|
26
26
|
const isFocused = hour => {
|
|
27
|
-
return isSelected(hour,
|
|
27
|
+
return isSelected(hour, adapter.getHours(valueOrReferenceDate));
|
|
28
28
|
};
|
|
29
29
|
const endHour = ampm ? 11 : 23;
|
|
30
30
|
for (let hour = 0; hour <= endHour; hour += timeStep) {
|
|
31
|
-
let label =
|
|
31
|
+
let label = adapter.format(adapter.setHours(now, hour), ampm ? 'hours12h' : 'hours24h');
|
|
32
32
|
const ariaLabel = resolveAriaLabel(parseInt(label, 10).toString());
|
|
33
|
-
label =
|
|
33
|
+
label = adapter.formatNumber(label);
|
|
34
34
|
result.push({
|
|
35
35
|
value: hour,
|
|
36
36
|
label,
|
|
@@ -44,7 +44,7 @@ export const getHourSectionOptions = ({
|
|
|
44
44
|
};
|
|
45
45
|
export const getTimeSectionOptions = ({
|
|
46
46
|
value,
|
|
47
|
-
|
|
47
|
+
adapter,
|
|
48
48
|
isDisabled,
|
|
49
49
|
timeStep,
|
|
50
50
|
resolveLabel,
|
|
@@ -66,7 +66,7 @@ export const getTimeSectionOptions = ({
|
|
|
66
66
|
const timeValue = timeStep * index;
|
|
67
67
|
return {
|
|
68
68
|
value: timeValue,
|
|
69
|
-
label:
|
|
69
|
+
label: adapter.formatNumber(resolveLabel(timeValue)),
|
|
70
70
|
isDisabled,
|
|
71
71
|
isSelected,
|
|
72
72
|
isFocused,
|
|
@@ -11,7 +11,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
11
11
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
12
12
|
import { DAY_MARGIN, DAY_SIZE } from "../internals/constants/dimensions.js";
|
|
13
13
|
import { pickerDay2Classes, getPickerDay2UtilityClass } from "./pickerDay2Classes.js";
|
|
14
|
-
import {
|
|
14
|
+
import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
|
|
15
15
|
import { usePickerDayOwnerState } from "../PickersDay/usePickerDayOwnerState.js";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
const useUtilityClasses = (ownerState, classes) => {
|
|
@@ -120,7 +120,7 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
120
120
|
props: inProps,
|
|
121
121
|
name: 'MuiPickerDay2'
|
|
122
122
|
});
|
|
123
|
-
const
|
|
123
|
+
const adapter = usePickerAdapter();
|
|
124
124
|
const {
|
|
125
125
|
autoFocus = false,
|
|
126
126
|
className,
|
|
@@ -207,7 +207,7 @@ const PickerDay2Raw = /*#__PURE__*/React.forwardRef(function PickerDay2(inProps,
|
|
|
207
207
|
}, other, {
|
|
208
208
|
ownerState: ownerState,
|
|
209
209
|
className: clsx(classes.root, className),
|
|
210
|
-
children: children ?? (ownerState.isDayFillerCell ? null :
|
|
210
|
+
children: children ?? (ownerState.isDayFillerCell ? null : adapter.format(day, 'dayOfMonth'))
|
|
211
211
|
}));
|
|
212
212
|
});
|
|
213
213
|
if (process.env.NODE_ENV !== "production") PickerDay2Raw.displayName = "PickerDay2Raw";
|
|
@@ -6,8 +6,8 @@ export interface PickersActionBarProps extends DialogActionsProps {
|
|
|
6
6
|
* Ordered array of actions to display.
|
|
7
7
|
* If empty, does not display that action bar.
|
|
8
8
|
* @default
|
|
9
|
-
* - `[]` for
|
|
10
|
-
* - `['cancel', '
|
|
9
|
+
* - `[]` for Pickers with one selection step which `closeOnSelect`.
|
|
10
|
+
* - `['cancel', 'nextOrAccept']` for all other Pickers.
|
|
11
11
|
*/
|
|
12
12
|
actions?: PickersActionBarAction[];
|
|
13
13
|
}
|
|
@@ -98,8 +98,8 @@ process.env.NODE_ENV !== "production" ? PickersActionBarComponent.propTypes = {
|
|
|
98
98
|
* Ordered array of actions to display.
|
|
99
99
|
* If empty, does not display that action bar.
|
|
100
100
|
* @default
|
|
101
|
-
* - `[]` for
|
|
102
|
-
* - `['cancel', '
|
|
101
|
+
* - `[]` for Pickers with one selection step which `closeOnSelect`.
|
|
102
|
+
* - `['cancel', 'nextOrAccept']` for all other Pickers.
|
|
103
103
|
*/
|
|
104
104
|
actions: PropTypes.arrayOf(PropTypes.oneOf(['accept', 'cancel', 'clear', 'next', 'nextOrAccept', 'today']).isRequired),
|
|
105
105
|
/**
|
|
@@ -12,8 +12,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
12
12
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
13
13
|
import composeClasses from '@mui/utils/composeClasses';
|
|
14
14
|
import IconButton from '@mui/material/IconButton';
|
|
15
|
-
import { usePickerTranslations } from "../hooks/
|
|
16
|
-
import { useUtils } from "../internals/hooks/useUtils.js";
|
|
15
|
+
import { usePickerAdapter, usePickerTranslations } from "../hooks/index.js";
|
|
17
16
|
import { PickersFadeTransitionGroup } from "../DateCalendar/PickersFadeTransitionGroup.js";
|
|
18
17
|
import { ArrowDropDownIcon } from "../icons/index.js";
|
|
19
18
|
import { PickersArrowSwitcher } from "../internals/components/PickersArrowSwitcher/index.js";
|
|
@@ -104,7 +103,7 @@ const PickersCalendarHeaderSwitchViewIcon = styled(ArrowDropDownIcon, {
|
|
|
104
103
|
*/
|
|
105
104
|
const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCalendarHeader(inProps, ref) {
|
|
106
105
|
const translations = usePickerTranslations();
|
|
107
|
-
const
|
|
106
|
+
const adapter = usePickerAdapter();
|
|
108
107
|
const props = useThemeProps({
|
|
109
108
|
props: inProps,
|
|
110
109
|
name: 'MuiPickersCalendarHeader'
|
|
@@ -127,7 +126,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
127
126
|
className,
|
|
128
127
|
classes: classesProp,
|
|
129
128
|
timezone,
|
|
130
|
-
format = `${
|
|
129
|
+
format = `${adapter.formats.month} ${adapter.formats.year}`
|
|
131
130
|
} = props,
|
|
132
131
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
133
132
|
const {
|
|
@@ -156,8 +155,8 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
156
155
|
className: classes.switchViewIcon
|
|
157
156
|
}),
|
|
158
157
|
switchViewIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
159
|
-
const selectNextMonth = () => onMonthChange(
|
|
160
|
-
const selectPreviousMonth = () => onMonthChange(
|
|
158
|
+
const selectNextMonth = () => onMonthChange(adapter.addMonths(month, 1));
|
|
159
|
+
const selectPreviousMonth = () => onMonthChange(adapter.addMonths(month, -1));
|
|
161
160
|
const isNextMonthDisabled = useNextMonthDisabled(month, {
|
|
162
161
|
disableFuture,
|
|
163
162
|
maxDate,
|
|
@@ -185,7 +184,7 @@ const PickersCalendarHeader = /*#__PURE__*/React.forwardRef(function PickersCale
|
|
|
185
184
|
if (views.length === 1 && views[0] === 'year') {
|
|
186
185
|
return null;
|
|
187
186
|
}
|
|
188
|
-
const label =
|
|
187
|
+
const label = adapter.formatByString(month, format);
|
|
189
188
|
return /*#__PURE__*/_jsxs(PickersCalendarHeaderRoot, _extends({}, other, {
|
|
190
189
|
ownerState: ownerState,
|
|
191
190
|
className: clsx(classes.root, className),
|
|
@@ -11,7 +11,7 @@ import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
12
|
import useForkRef from '@mui/utils/useForkRef';
|
|
13
13
|
import { alpha, styled, useThemeProps } from '@mui/material/styles';
|
|
14
|
-
import {
|
|
14
|
+
import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
|
|
15
15
|
import { DAY_SIZE, DAY_MARGIN } from "../internals/constants/dimensions.js";
|
|
16
16
|
import { getPickersDayUtilityClass, pickersDayClasses } from "./pickersDayClasses.js";
|
|
17
17
|
import { usePickerDayOwnerState } from "./usePickerDayOwnerState.js";
|
|
@@ -164,7 +164,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
|
|
|
164
164
|
showDaysOutsideCurrentMonth
|
|
165
165
|
});
|
|
166
166
|
const classes = useUtilityClasses(classesProp, ownerState);
|
|
167
|
-
const
|
|
167
|
+
const adapter = usePickerAdapter();
|
|
168
168
|
const ref = React.useRef(null);
|
|
169
169
|
const handleRef = useForkRef(ref, forwardedRef);
|
|
170
170
|
|
|
@@ -217,7 +217,7 @@ const PickersDayRaw = /*#__PURE__*/React.forwardRef(function PickersDay(inProps,
|
|
|
217
217
|
onMouseDown: handleMouseDown
|
|
218
218
|
}, other, {
|
|
219
219
|
ownerState: ownerState,
|
|
220
|
-
children: children ??
|
|
220
|
+
children: children ?? adapter.format(day, 'dayOfMonth')
|
|
221
221
|
}));
|
|
222
222
|
});
|
|
223
223
|
if (process.env.NODE_ENV !== "production") PickersDayRaw.displayName = "PickersDayRaw";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { usePickerPrivateContext } from "../internals/hooks/usePickerPrivateContext.js";
|
|
4
|
-
import {
|
|
4
|
+
import { usePickerAdapter } from "../hooks/usePickerAdapter.js";
|
|
5
5
|
export function usePickerDayOwnerState(parameters) {
|
|
6
6
|
const {
|
|
7
7
|
disabled,
|
|
@@ -13,7 +13,7 @@ export function usePickerDayOwnerState(parameters) {
|
|
|
13
13
|
disableHighlightToday,
|
|
14
14
|
showDaysOutsideCurrentMonth
|
|
15
15
|
} = parameters;
|
|
16
|
-
const
|
|
16
|
+
const adapter = usePickerAdapter();
|
|
17
17
|
const {
|
|
18
18
|
ownerState: pickerOwnerState
|
|
19
19
|
} = usePickerPrivateContext();
|
|
@@ -23,10 +23,10 @@ export function usePickerDayOwnerState(parameters) {
|
|
|
23
23
|
isDayDisabled: disabled ?? false,
|
|
24
24
|
isDayCurrent: today ?? false,
|
|
25
25
|
isDayOutsideMonth: outsideCurrentMonth ?? false,
|
|
26
|
-
isDayStartOfWeek:
|
|
27
|
-
isDayEndOfWeek:
|
|
26
|
+
isDayStartOfWeek: adapter.isSameDay(day, adapter.startOfWeek(day)),
|
|
27
|
+
isDayEndOfWeek: adapter.isSameDay(day, adapter.endOfWeek(day)),
|
|
28
28
|
disableMargin: disableMargin ?? false,
|
|
29
29
|
disableHighlightToday: disableHighlightToday ?? false,
|
|
30
30
|
showDaysOutsideCurrentMonth: showDaysOutsideCurrentMonth ?? false
|
|
31
|
-
}), [
|
|
31
|
+
}), [adapter, pickerOwnerState, day, selected, disabled, today, outsideCurrentMonth, disableMargin, disableHighlightToday, showDaysOutsideCurrentMonth]);
|
|
32
32
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
5
|
const _excluded = ["elements", "areAllSectionsEmpty", "defaultValue", "label", "value", "onChange", "id", "autoFocus", "endAdornment", "startAdornment", "renderSuffix", "slots", "slotProps", "contentEditable", "tabIndex", "onInput", "onPaste", "onKeyDown", "fullWidth", "name", "readOnly", "inputProps", "inputRef", "sectionListRef", "onFocus", "onBlur", "classes", "ownerState"];
|
|
@@ -107,7 +107,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
107
107
|
// ----------------------------------------------------------------------
|
|
108
108
|
/**
|
|
109
109
|
* 12h/24h view for hour selection clock.
|
|
110
|
-
* @default
|
|
110
|
+
* @default adapter.is12HourCycleInCurrentLocale()
|
|
111
111
|
*/
|
|
112
112
|
ampm: PropTypes.bool,
|
|
113
113
|
/**
|
|
@@ -60,7 +60,7 @@ StaticTimePicker.propTypes = {
|
|
|
60
60
|
// ----------------------------------------------------------------------
|
|
61
61
|
/**
|
|
62
62
|
* 12h/24h view for hour selection clock.
|
|
63
|
-
* @default
|
|
63
|
+
* @default adapter.is12HourCycleInCurrentLocale()
|
|
64
64
|
*/
|
|
65
65
|
ampm: PropTypes.bool,
|
|
66
66
|
/**
|
package/esm/TimeClock/Clock.js
CHANGED
|
@@ -7,8 +7,7 @@ import { styled, useThemeProps } from '@mui/material/styles';
|
|
|
7
7
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
9
|
import { ClockPointer } from "./ClockPointer.js";
|
|
10
|
-
import { usePickerTranslations } from "../hooks/
|
|
11
|
-
import { useUtils } from "../internals/hooks/useUtils.js";
|
|
10
|
+
import { usePickerAdapter, usePickerTranslations } from "../hooks/index.js";
|
|
12
11
|
import { CLOCK_HOUR_WIDTH, getHours, getMinutes } from "./shared.js";
|
|
13
12
|
import { getClockUtilityClass } from "./clockClasses.js";
|
|
14
13
|
import { formatMeridiem } from "../internals/utils/date-utils.js";
|
|
@@ -176,7 +175,7 @@ export function Clock(inProps) {
|
|
|
176
175
|
className,
|
|
177
176
|
classes: classesProp
|
|
178
177
|
} = props;
|
|
179
|
-
const
|
|
178
|
+
const adapter = usePickerAdapter();
|
|
180
179
|
const translations = usePickerTranslations();
|
|
181
180
|
const {
|
|
182
181
|
ownerState: pickerOwnerState
|
|
@@ -310,7 +309,7 @@ export function Clock(inProps) {
|
|
|
310
309
|
})]
|
|
311
310
|
}), /*#__PURE__*/_jsx(ClockWrapper, {
|
|
312
311
|
"aria-activedescendant": selectedId,
|
|
313
|
-
"aria-label": translations.clockLabelText(type, value == null ? null :
|
|
312
|
+
"aria-label": translations.clockLabelText(type, value == null ? null : adapter.format(value, ampm ? 'fullTime12h' : 'fullTime24h')),
|
|
314
313
|
ref: listboxRef,
|
|
315
314
|
role: "listbox",
|
|
316
315
|
onKeyDown: handleKeyDown,
|
|
@@ -324,22 +323,22 @@ export function Clock(inProps) {
|
|
|
324
323
|
disabled: disabled || meridiemMode === null,
|
|
325
324
|
ownerState: ownerState,
|
|
326
325
|
className: classes.amButton,
|
|
327
|
-
title: formatMeridiem(
|
|
326
|
+
title: formatMeridiem(adapter, 'am'),
|
|
328
327
|
children: /*#__PURE__*/_jsx(ClockMeridiemText, {
|
|
329
328
|
variant: "caption",
|
|
330
329
|
className: classes.meridiemText,
|
|
331
|
-
children: formatMeridiem(
|
|
330
|
+
children: formatMeridiem(adapter, 'am')
|
|
332
331
|
})
|
|
333
332
|
}), /*#__PURE__*/_jsx(ClockPmButton, {
|
|
334
333
|
disabled: disabled || meridiemMode === null,
|
|
335
334
|
onClick: readOnly ? undefined : () => handleMeridiemChange('pm'),
|
|
336
335
|
ownerState: ownerState,
|
|
337
336
|
className: classes.pmButton,
|
|
338
|
-
title: formatMeridiem(
|
|
337
|
+
title: formatMeridiem(adapter, 'pm'),
|
|
339
338
|
children: /*#__PURE__*/_jsx(ClockMeridiemText, {
|
|
340
339
|
variant: "caption",
|
|
341
340
|
className: classes.meridiemText,
|
|
342
|
-
children: formatMeridiem(
|
|
341
|
+
children: formatMeridiem(adapter, 'pm')
|
|
343
342
|
})
|
|
344
343
|
})]
|
|
345
344
|
})]
|
|
@@ -12,7 +12,7 @@ interface GetHourNumbersOptions {
|
|
|
12
12
|
* Should only be `undefined` on the server
|
|
13
13
|
*/
|
|
14
14
|
selectedId: string | undefined;
|
|
15
|
-
|
|
15
|
+
adapter: MuiPickersAdapter;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* @ignore - internal component.
|
|
@@ -23,10 +23,10 @@ export declare const getHourNumbers: ({
|
|
|
23
23
|
getClockNumberText,
|
|
24
24
|
isDisabled,
|
|
25
25
|
selectedId,
|
|
26
|
-
|
|
26
|
+
adapter
|
|
27
27
|
}: GetHourNumbersOptions) => React.JSX.Element[];
|
|
28
28
|
export declare const getMinutesNumbers: ({
|
|
29
|
-
|
|
29
|
+
adapter,
|
|
30
30
|
value,
|
|
31
31
|
isDisabled,
|
|
32
32
|
getClockNumberText,
|
|
@@ -10,9 +10,9 @@ export const getHourNumbers = ({
|
|
|
10
10
|
getClockNumberText,
|
|
11
11
|
isDisabled,
|
|
12
12
|
selectedId,
|
|
13
|
-
|
|
13
|
+
adapter
|
|
14
14
|
}) => {
|
|
15
|
-
const currentHours = value ?
|
|
15
|
+
const currentHours = value ? adapter.getHours(value) : null;
|
|
16
16
|
const hourNumbers = [];
|
|
17
17
|
const startHour = ampm ? 1 : 0;
|
|
18
18
|
const endHour = ampm ? 12 : 23;
|
|
@@ -34,7 +34,7 @@ export const getHourNumbers = ({
|
|
|
34
34
|
label = '00';
|
|
35
35
|
}
|
|
36
36
|
const inner = !ampm && (hour === 0 || hour > 12);
|
|
37
|
-
label =
|
|
37
|
+
label = adapter.formatNumber(label);
|
|
38
38
|
const selected = isSelected(hour);
|
|
39
39
|
hourNumbers.push(/*#__PURE__*/_jsx(ClockNumber, {
|
|
40
40
|
id: selected ? selectedId : undefined,
|
|
@@ -49,13 +49,13 @@ export const getHourNumbers = ({
|
|
|
49
49
|
return hourNumbers;
|
|
50
50
|
};
|
|
51
51
|
export const getMinutesNumbers = ({
|
|
52
|
-
|
|
52
|
+
adapter,
|
|
53
53
|
value,
|
|
54
54
|
isDisabled,
|
|
55
55
|
getClockNumberText,
|
|
56
56
|
selectedId
|
|
57
57
|
}) => {
|
|
58
|
-
const f =
|
|
58
|
+
const f = adapter.formatNumber;
|
|
59
59
|
return [[5, f('05')], [10, f('10')], [15, f('15')], [20, f('20')], [25, f('25')], [30, f('30')], [35, f('35')], [40, f('40')], [45, f('45')], [50, f('50')], [55, f('55')], [0, f('00')]].map(([numberValue, label], index) => {
|
|
60
60
|
const selected = numberValue === value;
|
|
61
61
|
return /*#__PURE__*/_jsx(ClockNumber, {
|