Skip to content

bug(DATEPICKER): dateAdapter.setLocale('fa') not working properly #24861

@newshahn

Description

@newshahn

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 using Angular material datepicker with locale('fa) which is persian/jalali calendar, today date is 1 day ahead. So for example, today is Ordibehesht 12th but material datepicker is showing Ordibehesht 13th. Moreover, when I choose a date in the datepicker, for example (۱۹/۴/۱۳۷۶), the datepicker closes and the date that is shown in the input isn't actually what I chose. Instead it's (۱۷/۴/۱۳۷۶).

Reproduction

https://components-issue-mle1fv.stackblitz.io

Expected Behavior

For today's date to be shown correctly and the input value to be the same as the date selected.

Actual Behavior

Today's date is not shown correctly and the input value of the datepicker is not the same as the date selected.

Environment

  • Angular: 13.3.2
  • CDK/Material: 13.3.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/datepicker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions