@mui/x-date-pickers 8.28.3 → 8.28.4
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 +31 -0
- package/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +3 -3
- package/esm/AdapterDayjs/AdapterDayjs.js +1 -13
- 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,37 @@
|
|
|
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.4
|
|
9
|
+
|
|
10
|
+
_Apr 27, 2026_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 3 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
17
|
+
@supunsathsara
|
|
18
|
+
|
|
19
|
+
The following team members contributed to this release:
|
|
20
|
+
@LukasTy, @michelengelen
|
|
21
|
+
|
|
22
|
+
### Date and Time Pickers
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-date-pickers@8.28.4`
|
|
25
|
+
|
|
26
|
+
- [pickers] Fix `DateRangeCalendar` drag with `AdapterDayjs` plain-constructor values (#22170) @LukasTy
|
|
27
|
+
- [pickers] Fix disabled state not overriding error border color (#22186) @supunsathsara
|
|
28
|
+
- [pickers] Use `convertToMeridiem` utility in `transferDateSectionValue` (#22132) @michelengelen
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-date-pickers-pro@8.28.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-date-pickers@8.28.4`.
|
|
33
|
+
|
|
34
|
+
### Docs
|
|
35
|
+
|
|
36
|
+
- [docs] Remove obsolete v7 deprecation warning for `dayOfWeekFormatter` (#22120) @LukasTy
|
|
37
|
+
- [docs] Use mui.com for broken links checker known targets (#22171) @LukasTy
|
|
38
|
+
|
|
8
39
|
## 8.28.3
|
|
9
40
|
|
|
10
41
|
_Apr 15, 2026_
|
|
@@ -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 */
|
|
@@ -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
|
{
|