angular / angular/components

bug(Datepicker): Datepicker with Moment ignores locale

Đang mở
#28,263 20 bình luận 6 reaction 0 người được giao Xem trên GitHub
area: material/datepicker P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và mat-datepicker được cấu hình với Moment cùng locale tiếng Đức. So sánh hành vi giữa Angular 16 và Angular 17, sau đó lần theo cách datepicker xử lý locale để xác định vì sao tên tháng lại fallback về tiếng Anh. Được xem là hoàn tất khi bản tái hiện hiển thị tên tháng bằng tiếng Đức sau khi nâng cấp và regression được bao phủ bởi các test liên quan của dự án.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.