angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.32k stars 6.73k forks source link

date picker using 'ar-SA' locale, displayed dates not correct, while value is ok. #29500

Open DevAliMaher opened 1 month ago

DevAliMaher commented 1 month ago

Is this a regression?

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:

import LocaleSA from '@angular/common/locales/ar-SA';
registerLocaleData(LocaleSA, LanguageEnum.AR);
    provideNativeDateAdapter(),
    { provide: MAT_DATE_LOCALE, useValue: 'ar-SA' },

image

Reproduction

StackBlitz link: Steps to reproduce:

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

amysorto commented 1 month ago

Can you provide a Stackblitz of your example?

DevAliMaher commented 1 month ago

@amysorto https://stackblitz.com/edit/stackblitz-starters-gq9csg?file=src%2Fglobal_styles.scss