Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

docs-bug(datepicker): Wrong docs for parsing dates as UTC with luxon

Đang mở
#32,935 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, typescript
Lĩnh vực
documentation

Hướng nghiên cứu

Mở trang tổng quan datepicker bị ảnh hưởng và so sánh ví dụ LuxonDateAdapter trên đó với mã nguồn adapter được liên kết tại src/material-luxon-adapter/adapter/index.ts. Xem xét PR hiện có và cập nhật tài liệu để cấu hình được mô tả khớp với API được hỗ trợ, đồng thời thiết lập UTC được ghi trong tài liệu là chính xác.

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

Mô tả

area: material/datepicker docs P3
Documentation Feedback

The docs include this extract:

By default the LuxonDateAdapter creates dates in your time zone specific locale. You can change the default behaviour to parse dates as UTC by passing useUtc: true into provideLuxonDateAdapter:

bootstrapApplication(MyApp, {
  providers: [provideLuxonDateAdapter(undefined, {useUtc: true})]
});

provideLuxonDateAdapter() only takes the 1 parameter, no second options with useUtc.

My guess is this is a holdover from Moment, which does have this option.
It would be nice, and fairly easy, to actually have this same option.
edit: I went ahead and made a PR copying the Moment adapter.

The current actual way to achieve it is:

bootstrapApplication(MyApp, {
  providers: [
    provideLuxonDateAdapter(),
    {
      provide: MAT_LUXON_DATE_ADAPTER_OPTIONS,
      useValue: {
        useUtc: true,
      } satisfies Partial<MatLuxonDateAdapterOptions>,
    },
  ]
});
Affected documentation page

https://material.angular.dev/components/datepicker/overview#choosing-a-date-implementation-and-date-format-settings

Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
92

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/components

Tất cả issue của angular/components

Issue tương tự

Thêm issue về TypeScript

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.