@mui/x-date-pickers 8.28.3 → 8.28.5
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/AdapterDayjs/AdapterDayjs.js +1 -13
- package/CHANGELOG.md +81 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +8 -1
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +3 -3
- package/esm/AdapterDayjs/AdapterDayjs.js +1 -13
- package/esm/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +8 -1
- package/esm/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +3 -3
- package/esm/index.js +1 -1
- package/esm/internals/hooks/useField/useField.utils.js +3 -9
- package/index.js +1 -1
- package/internals/hooks/useField/useField.utils.js +3 -9
- package/package.json +1 -1
|
@@ -213,19 +213,7 @@ class AdapterDayjs {
|
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
createSystemDate = value => {
|
|
216
|
-
|
|
217
|
-
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
218
|
-
const timezone = _dayjs.default.tz.guess();
|
|
219
|
-
if (timezone === 'UTC') {
|
|
220
|
-
date = (0, _dayjs.default)(value);
|
|
221
|
-
} /* v8 ignore next 3 */else {
|
|
222
|
-
// We can't change the system timezone in the tests
|
|
223
|
-
date = _dayjs.default.tz(value, timezone);
|
|
224
|
-
}
|
|
225
|
-
} else {
|
|
226
|
-
date = (0, _dayjs.default)(value);
|
|
227
|
-
}
|
|
228
|
-
return this.setLocaleToValue(date);
|
|
216
|
+
return this.setLocaleToValue((0, _dayjs.default)(value));
|
|
229
217
|
};
|
|
230
218
|
createUTCDate = value => {
|
|
231
219
|
/* v8 ignore next 3 */
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,87 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.28.5
|
|
9
|
+
|
|
10
|
+
_May 8, 2026_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 2 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
The following team members contributed to this release:
|
|
17
|
+
@LukasTy, @MBilalShafi
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@8.28.5`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix active filter detection for array values (#22357) @MBilalShafi
|
|
24
|
+
- [DataGrid] Fix crash when grouping/tree-data values match `Object.prototype` property names (#22343) @LukasTy
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@8.28.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@8.28.5`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@8.28.5` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@8.28.5`.
|
|
33
|
+
|
|
34
|
+
### Date and Time Pickers
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-date-pickers@8.28.5`
|
|
37
|
+
|
|
38
|
+
- [pickers] Fix duplicate hour label in `MultiSectionDigitalClock` on DST day (#22350) @LukasTy
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@8.28.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@8.28.5`.
|
|
43
|
+
|
|
44
|
+
### Tree View
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-tree-view@8.28.5`
|
|
47
|
+
|
|
48
|
+
- [tree view] Fix stale Tree View `apiRef` after keyed remount (#22355) @MBilalShafi
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-tree-view-pro@8.28.5` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-tree-view@8.28.5`.
|
|
53
|
+
|
|
54
|
+
### Core
|
|
55
|
+
|
|
56
|
+
- [code-infra] Fix broken `valelint` and docs build (#22362) @LukasTy
|
|
57
|
+
|
|
58
|
+
## 8.28.4
|
|
59
|
+
|
|
60
|
+
_Apr 27, 2026_
|
|
61
|
+
|
|
62
|
+
We'd like to extend a big thank you to the 3 contributors who made this release possible. Here are some highlights ✨:
|
|
63
|
+
|
|
64
|
+
- 🐞 Bugfixes
|
|
65
|
+
|
|
66
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
67
|
+
@supunsathsara
|
|
68
|
+
|
|
69
|
+
The following team members contributed to this release:
|
|
70
|
+
@LukasTy, @michelengelen
|
|
71
|
+
|
|
72
|
+
### Date and Time Pickers
|
|
73
|
+
|
|
74
|
+
#### `@mui/x-date-pickers@8.28.4`
|
|
75
|
+
|
|
76
|
+
- [pickers] Fix `DateRangeCalendar` drag with `AdapterDayjs` plain-constructor values (#22170) @LukasTy
|
|
77
|
+
- [pickers] Fix disabled state not overriding error border color (#22186) @supunsathsara
|
|
78
|
+
- [pickers] Use `convertToMeridiem` utility in `transferDateSectionValue` (#22132) @michelengelen
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-date-pickers-pro@8.28.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-date-pickers@8.28.4`.
|
|
83
|
+
|
|
84
|
+
### Docs
|
|
85
|
+
|
|
86
|
+
- [docs] Remove obsolete v7 deprecation warning for `dayOfWeekFormatter` (#22120) @LukasTy
|
|
87
|
+
- [docs] Use mui.com for broken links checker known targets (#22171) @LukasTy
|
|
88
|
+
|
|
8
89
|
## 8.28.3
|
|
9
90
|
|
|
10
91
|
_Apr 15, 2026_
|
|
@@ -32,9 +32,16 @@ const getHourSectionOptions = ({
|
|
|
32
32
|
const isFocused = hour => {
|
|
33
33
|
return isSelected(hour, adapter.getHours(valueOrReferenceDate));
|
|
34
34
|
};
|
|
35
|
+
|
|
36
|
+
// Anchor label generation to a fixed non-transition day (month=0, day=15) —
|
|
37
|
+
// `adapter.setHours(now, N)` on a transition day can roll forward and emit
|
|
38
|
+
// duplicate labels (see https://github.com/mui/mui-x/issues/22084). Order:
|
|
39
|
+
// `setMonth` first so day-overflow is harmless; non-Gregorian adapters land
|
|
40
|
+
// on a different month-15 here but are all TZ-incompatible.
|
|
41
|
+
const labelReferenceDate = adapter.setDate(adapter.setMonth(adapter.startOfDay(now), 0), 15);
|
|
35
42
|
const endHour = ampm ? 11 : 23;
|
|
36
43
|
for (let hour = 0; hour <= endHour; hour += timeStep) {
|
|
37
|
-
let label = adapter.format(adapter.setHours(
|
|
44
|
+
let label = adapter.format(adapter.setHours(labelReferenceDate, hour), ampm ? 'hours12h' : 'hours24h');
|
|
38
45
|
const ariaLabel = resolveAriaLabel(parseInt(label, 10).toString());
|
|
39
46
|
label = adapter.formatNumber(label);
|
|
40
47
|
result.push({
|
|
@@ -44,6 +44,9 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
|
|
|
44
44
|
borderStyle: 'solid',
|
|
45
45
|
borderWidth: 2
|
|
46
46
|
},
|
|
47
|
+
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
48
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
49
|
+
},
|
|
47
50
|
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.disabled}`]: {
|
|
48
51
|
[`& .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
49
52
|
borderColor: (theme.vars || theme).palette.action.disabled
|
|
@@ -52,9 +55,6 @@ const PickersOutlinedInputRoot = (0, _styles.styled)(_PickersInputBase2.PickersI
|
|
|
52
55
|
color: (theme.vars || theme).palette.action.disabled
|
|
53
56
|
}
|
|
54
57
|
},
|
|
55
|
-
[`&.${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.error} .${_pickersOutlinedInputClasses.pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
56
|
-
borderColor: (theme.vars || theme).palette.error.main
|
|
57
|
-
},
|
|
58
58
|
variants: Object.keys((theme.vars ?? theme).palette)
|
|
59
59
|
// @ts-ignore
|
|
60
60
|
.filter(key => (theme.vars ?? theme).palette[key]?.main ?? false).map(color => ({
|
|
@@ -203,19 +203,7 @@ export class AdapterDayjs {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
createSystemDate = value => {
|
|
206
|
-
|
|
207
|
-
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
208
|
-
const timezone = dayjs.tz.guess();
|
|
209
|
-
if (timezone === 'UTC') {
|
|
210
|
-
date = dayjs(value);
|
|
211
|
-
} /* v8 ignore next 3 */else {
|
|
212
|
-
// We can't change the system timezone in the tests
|
|
213
|
-
date = dayjs.tz(value, timezone);
|
|
214
|
-
}
|
|
215
|
-
} else {
|
|
216
|
-
date = dayjs(value);
|
|
217
|
-
}
|
|
218
|
-
return this.setLocaleToValue(date);
|
|
206
|
+
return this.setLocaleToValue(dayjs(value));
|
|
219
207
|
};
|
|
220
208
|
createUTCDate = value => {
|
|
221
209
|
/* v8 ignore next 3 */
|
|
@@ -26,9 +26,16 @@ export const getHourSectionOptions = ({
|
|
|
26
26
|
const isFocused = hour => {
|
|
27
27
|
return isSelected(hour, adapter.getHours(valueOrReferenceDate));
|
|
28
28
|
};
|
|
29
|
+
|
|
30
|
+
// Anchor label generation to a fixed non-transition day (month=0, day=15) —
|
|
31
|
+
// `adapter.setHours(now, N)` on a transition day can roll forward and emit
|
|
32
|
+
// duplicate labels (see https://github.com/mui/mui-x/issues/22084). Order:
|
|
33
|
+
// `setMonth` first so day-overflow is harmless; non-Gregorian adapters land
|
|
34
|
+
// on a different month-15 here but are all TZ-incompatible.
|
|
35
|
+
const labelReferenceDate = adapter.setDate(adapter.setMonth(adapter.startOfDay(now), 0), 15);
|
|
29
36
|
const endHour = ampm ? 11 : 23;
|
|
30
37
|
for (let hour = 0; hour <= endHour; hour += timeStep) {
|
|
31
|
-
let label = adapter.format(adapter.setHours(
|
|
38
|
+
let label = adapter.format(adapter.setHours(labelReferenceDate, hour), ampm ? 'hours12h' : 'hours24h');
|
|
32
39
|
const ariaLabel = resolveAriaLabel(parseInt(label, 10).toString());
|
|
33
40
|
label = adapter.formatNumber(label);
|
|
34
41
|
result.push({
|
|
@@ -37,6 +37,9 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
37
37
|
borderStyle: 'solid',
|
|
38
38
|
borderWidth: 2
|
|
39
39
|
},
|
|
40
|
+
[`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
41
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
42
|
+
},
|
|
40
43
|
[`&.${pickersOutlinedInputClasses.disabled}`]: {
|
|
41
44
|
[`& .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
42
45
|
borderColor: (theme.vars || theme).palette.action.disabled
|
|
@@ -45,9 +48,6 @@ const PickersOutlinedInputRoot = styled(PickersInputBaseRoot, {
|
|
|
45
48
|
color: (theme.vars || theme).palette.action.disabled
|
|
46
49
|
}
|
|
47
50
|
},
|
|
48
|
-
[`&.${pickersOutlinedInputClasses.error} .${pickersOutlinedInputClasses.notchedOutline}`]: {
|
|
49
|
-
borderColor: (theme.vars || theme).palette.error.main
|
|
50
|
-
},
|
|
51
51
|
variants: Object.keys((theme.vars ?? theme).palette)
|
|
52
52
|
// @ts-ignore
|
|
53
53
|
.filter(key => (theme.vars ?? theme).palette[key]?.main ?? false).map(color => ({
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getMonthsInYear } from "../../utils/date-utils.js";
|
|
2
|
+
import { convertToMeridiem } from "../../utils/time-utils.js";
|
|
2
3
|
export const getDateSectionConfigFromFormatToken = (adapter, formatToken) => {
|
|
3
4
|
const config = adapter.formatTokenMap[formatToken];
|
|
4
5
|
if (config == null) {
|
|
@@ -378,15 +379,8 @@ const transferDateSectionValue = (adapter, section, dateToTransferFrom, dateToTr
|
|
|
378
379
|
}
|
|
379
380
|
case 'meridiem':
|
|
380
381
|
{
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
if (isAM && mergedDateHours >= 12) {
|
|
384
|
-
return adapter.addHours(dateToTransferTo, -12);
|
|
385
|
-
}
|
|
386
|
-
if (!isAM && mergedDateHours < 12) {
|
|
387
|
-
return adapter.addHours(dateToTransferTo, 12);
|
|
388
|
-
}
|
|
389
|
-
return dateToTransferTo;
|
|
382
|
+
const meridiem = adapter.getHours(dateToTransferFrom) < 12 ? 'am' : 'pm';
|
|
383
|
+
return convertToMeridiem(dateToTransferTo, meridiem, true, adapter);
|
|
390
384
|
}
|
|
391
385
|
case 'hours':
|
|
392
386
|
{
|
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForV7HiddenInputFromSections = exports.createDateStrForV6InputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = exports.FORMAT_SECONDS_NO_LEADING_ZEROS = void 0;
|
|
7
7
|
var _dateUtils = require("../../utils/date-utils");
|
|
8
|
+
var _timeUtils = require("../../utils/time-utils");
|
|
8
9
|
const getDateSectionConfigFromFormatToken = (adapter, formatToken) => {
|
|
9
10
|
const config = adapter.formatTokenMap[formatToken];
|
|
10
11
|
if (config == null) {
|
|
@@ -401,15 +402,8 @@ const transferDateSectionValue = (adapter, section, dateToTransferFrom, dateToTr
|
|
|
401
402
|
}
|
|
402
403
|
case 'meridiem':
|
|
403
404
|
{
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
if (isAM && mergedDateHours >= 12) {
|
|
407
|
-
return adapter.addHours(dateToTransferTo, -12);
|
|
408
|
-
}
|
|
409
|
-
if (!isAM && mergedDateHours < 12) {
|
|
410
|
-
return adapter.addHours(dateToTransferTo, 12);
|
|
411
|
-
}
|
|
412
|
-
return dateToTransferTo;
|
|
405
|
+
const meridiem = adapter.getHours(dateToTransferFrom) < 12 ? 'am' : 'pm';
|
|
406
|
+
return (0, _timeUtils.convertToMeridiem)(dateToTransferTo, meridiem, true, adapter);
|
|
413
407
|
}
|
|
414
408
|
case 'hours':
|
|
415
409
|
{
|