components icon indicating copy to clipboard operation
components copied to clipboard

Improvement (Datepicker): Having a gregorian calendar even when locale is set to Arabic

Open KirilZafirov opened this issue 3 years ago • 0 comments
trafficstars

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

I would like to be able to have a configuration option where I would be able to set the locale of the calendar to Arabic. This is now easily configurable when we set the locale to Arabic but doing this we also do change it to using Lunar calendar rather then the Gregorian calendar.

An example behavior that I get with this is the following

E.g. The DatePicker is showing Friday 25 March as the date, but the dropdown picker highlights 27th of Jamadi Akhar (6th lunar month), and showing on top right 22/8/1443. FYI 25 March 2022 = 22/8/1443, and the 8th lunar month is shaban

So I would like to have a configuration option so that we I am able to set the type of calendar I want to use.

Reproduction

Steps to reproduce:

  1. { provide: MAT_DATE_LOCALE, useFactory 'ar-AR' }
  2. Use Angular material Date picker
  3. Set 25-th March as default date
  4. When you open the page to view the calendar it is showing Friday 25th March (in arabic) but the dropdown picker highlights 27th of Jamadi Akhar (6th lunar month) and showing on top right 22/8/1443.

Expected Behavior

Use the Gregorian calendar for all localizations unless specified otherwise.

When using Arabic for localization for the calendar I would expect for the Gregorian month names and weekday names to be translated.

The value of the date and the selected date in the dropdown picker which is highlighted should match.

This would be good if we have the option to configure the the type of calendar.

Actual Behavior

image

Environment

  • Angular: 14.0.3, -Angular/cli: 14.0.0
  • CDK/Material: 14.0.3
  • Browser(s): All Browsers and Devices

KirilZafirov avatar Jul 12 '22 15:07 KirilZafirov