angular / angular/components

bug(Datepicker): Datepicker with Moment ignores locale

Ouverte
#28,263 20 commentaires 6 réactions 0 personnes assignées Voir sur GitHub
area: material/datepicker P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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

16

### Description

Since updating to Angular 17, my mat-datepicker ignores my locale. Everything should be in German but instead it's all in English now.

### Reproduction

StackBlitz link: https://components-issue-uudyxr.stackblitz.io
Steps to reproduce:
1. Open the datepicker to select a date
2. Select a year and a month

### Expected Behavior

The months are displayed in German (screenshot taken from production environment that doesn't have the update to Angular 17 yet).

![image](https://github.com/angular/components/assets/141422285/662124c9-f17b-4181-a378-a103ee3c9d25)
![image](https://github.com/angular/components/assets/141422285/ce836090-536a-448b-b58f-80e88172da78)

### Actual Behavior

The months are displayed in English

![image](https://github.com/angular/components/assets/141422285/dc658296-25f4-4221-9938-1b0b62df07e8)
![image](https://github.com/angular/components/assets/141422285/5ff86a70-2566-4979-8117-aa35ce27a4f8)

### Environment

- Angular: 17.0.6
- CDK/Material: 17.0.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et le mat-datepicker configuré avec Moment et un locale allemand. Comparez le comportement entre Angular 16 et Angular 17, puis suivez la gestion du locale du datepicker afin d'identifier pourquoi les noms des mois repassent en anglais. Le travail est terminé lorsque la reproduction affiche les noms des mois en allemand après la mise à niveau et que la régression est couverte par les tests pertinents du projet.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.