Skip to content

bug(datepicker): Localized date format issue #30910

@LuisTovar0

Description

@LuisTovar0

MatDatepicker seems to not accept dates in dd/mm/yyyy format, even when the MAT_DATE_LOCALE and DateAdapter's locale are set to a language/locale where this format is the standard.

I have noticed that this problem can be circumvented with the MomentJS date adapter for Angular, but it shouldn't be required since it's expected behaviour.

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-4gjjc1ce?file=src%2Fapp%2Fapp.component.ts

Steps to reproduce:

  1. Select pt-PT or fr-FR
  2. Type "15/12/2024" in the datepicker and hit tab
  3. Now type "12/15/2024" and hit tab

Expected Behavior

In step 2, the datepicker should consider that a valid date
In step 3, the datepicker should not consider that a valid date

Actual Behavior

In step 2, the datepicker considers the date invalid
In step 3, the datepicker changes the string to 15/12/2024, making it become valid

Environment

Angular CLI: 19.2.7
CDK/Material:19.2.9
Node: 20.19.0
Package Manager: pnpm 8.15.6
OS: linux x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions