Describe the bug
When manually editing the year in an MUI X <DatePicker /> using the Day.js adapter, the day resets to 01 after entering the third digit of the year if the date picker timezone differs from the system timezone.
The issue appears to be daylight savings time related as it is only present when both timezones observe daylight savings time.
The behavior only affects the @mui/x-date-pickers/AdapterDayjs adapter. The date picker works correctly when using the @mui/x-date-pickers/AdapterLuxon adapter.
Steps to reproduce:
* Must be performed with a system timezone that is not America/Chicago.
- On the MUI React Date Pickers page navigate to the date picker selector under the "Supported timezone" heading.
- Select the AMERICA/CHICAGO tab.
- In the date picker, edit the year by typing in 2-0-2-2.
- The day will change from
17 to 01 when 2-0-2 is entered.
System timezones where the issue occurs:
America/New_York
America/Denver
America/Los_Angeles
System timezone where the issue does not occur:
Expected behavior
The day remains the same when editing the year.
Information
- Day.js Version: v1.11.19
- OS: Windows 11
- Browser: Microsoft Edge Version 145.0
- Time zone: GMT-05:00 DST (Eastern Standard Time)
Describe the bug
When manually editing the year in an MUI X
<DatePicker />using the Day.js adapter, the day resets to01after entering the third digit of the year if the date picker timezone differs from the system timezone.The issue appears to be daylight savings time related as it is only present when both timezones observe daylight savings time.
The behavior only affects the
@mui/x-date-pickers/AdapterDayjsadapter. The date picker works correctly when using the@mui/x-date-pickers/AdapterLuxonadapter.Steps to reproduce:
* Must be performed with a system timezone that is not
America/Chicago.17to01when 2-0-2 is entered.System timezones where the issue occurs:
America/New_YorkAmerica/DenverAmerica/Los_AngelesSystem timezone where the issue does not occur:
Pacific/HonoluluExpected behavior
The day remains the same when editing the year.
Information