Skip to content

bug(MatDatePicker): NativeDatePicker not using the correct format initially #31107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task
Ben555555 opened this issue May 13, 2025 · 0 comments
Open
1 task
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Ben555555
Copy link

Ben555555 commented May 13, 2025

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When I use the following setup:


provideNativeDateAdapter({
            parse: {
              dateInput: 'DD.MM.YYYY',
            },
            display: {
              dateInput: 'DD.MM.YYYY',
              monthYearLabel: 'MMM YYYY',
              dateA11yLabel: 'LL',
              monthYearA11yLabel: 'MMMM YYYY',
            },
          }),
{
            provide: LOCALE_ID,
            useValue: 'de-CH'
        },

the DatePicker will show the date in the wrong format: "13.5.2025" instead of "13.05.2025". Why are the format options ignored?

Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

Expected Behavior

Date is formatted as "13.05.2025".

Actual Behavior

Date is formatted as "13.5.2025".

Environment

  • Angular: 19.1.4
  • CDK/Material: 19.1.5
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11
@Ben555555 Ben555555 added the needs triage This issue needs to be triaged by the team label May 13, 2025
@andrewseguin andrewseguin added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants