date picker using 'ar-SA' locale, displayed dates not correct, while value is ok.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### Is this a regression?
- [X] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
17
### Description
I used to use Date Picker with Hijri dates, using native adabter and every thing works fine, after updating to angular 18.1 I got this issue:
* in main.ts => regist SA locale
```
import LocaleSA from '@angular/common/locales/ar-SA';
registerLocaleData(LocaleSA, LanguageEnum.AR);
```
* in app.config.ts => provide native adapter
```
provideNativeDateAdapter(),
{ provide: MAT_DATE_LOCALE, useValue: 'ar-SA' },
```

### Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
### Expected Behavior
I expect to see the correct Hijri date in this case Muharram / محرم first month of Hijri year not Shawal / شوال, and day is 22 not 30
### Actual Behavior
the calendar point at 30/Shawal not 22/Muharram, 30/شوال not 22/محرم
### Environment
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit der Überprüfung der Locale-Registrierung in main.ts sowie des nativen Date-Adapters und der MAT_DATE_LOCALE-Konfiguration in app.config.ts. Reproduzieren Sie den Date Picker mit der ar-SA-Locale und überprüfen Sie anschließend, ob der angezeigte Hijri-Monat und -Tag mit dem ausgewählten Wert übereinstimmen, insbesondere 22 Muharram statt 30 Shawal.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend, localization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100