Skip to content

[pickers][DateTimeRangePicker] Polish locale from dayjs breaks datetime format in DateTimeRangePicker since v.7.10.0 #14334

@oskarkk

Description

@oskarkk

Steps to reproduce

Link to live example:
Correct in 7.9.0: https://codesandbox.io/p/sandbox/mui-daterangepicker-format-issue-7-9-0-jg2c5f
Incorrect in 7.10.0: https://codesandbox.io/p/sandbox/mui-datetimerangepicker-format-issue-7-10-0-6hdc22
Incorrect in 7.14.0: https://codesandbox.io/p/sandbox/mui-datetimerangepicker-format-issue-latest-cdnst2

The issue appears when using polish locale:

      <LocalizationProvider
        dateAdapter={AdapterDayjs}
        adapterLocale={dayjs.locale("pl")}
      >
        <DateTimeRangePicker<Dayjs>
          value={[dayjs("2020-02-02T00:00:00"), dayjs("2020-02-03T00:00:00")]}
          slots={{ field: SingleInputDateTimeRangeField }}
          sx={{ "& .MuiInputBase-root": { width: "250px" } }}
        />
      </LocalizationProvider>

Current behavior

On x-date-pickers version >= 7.10.0 the picker displays date in format 02 00:00 – 03 00:00, not showing month and year.

Expected behavior

On x-date-pickers version <= 7.9.0 the picker was working correctly displaying format: 02.02.2020 00:00 – 03.02.2020 00:00

Context

No response

Your environment

Version that works:
"dayjs": "1.11.13",
"@mui/material": "5.16.7",
"@mui/x-date-pickers-pro": "7.9.0"

Version that doesn't work:
"dayjs": "1.11.13",
"@mui/material": "5.16.7",
"@mui/x-date-pickers-pro": "7.10.0"

Search keywords: locale, dayjs
Order ID: Order 80141

Metadata

Metadata

Labels

plan: ProImpact at least one Pro user.scope: pickersChanges related to the date/time pickers.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions