angular / angular/components

bug(material/datepicker): Re-evaluate how the MatDatepicker handles timezones

Đang mở
#11,027 5 bình luận 8 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ả

#### Bug, feature request, or proposal:
Documentation request

#### What is the expected behavior?
The moment object returned by selecting a date with Datepicker should have no timezone information (or UTC)

#### What is the current behavior?
Currently the moment object looks like this: Wed Apr 18 2018 00:00:00 GMT+0300
(The user is located in GMT+3, so his timezone is used)

#### What is the use-case or motivation for changing an existing behavior?
I wonder how to make my matDatepicker return UTC dates so that they are independent of the timezone the user is currently in. I've found lots of issues regarding this (https://github.com/angular/material2/issues/7167), but no clear and simple explanation on how to easily achieve that.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.0, Angular Material 6.0.0-beta.4, Typescript 2.5.3, ANY browser (not just IE!)

#### Is there anything else we should know?
I'm importing MatMomentDateModule, so all the dates in the app are momentjs dates.

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 tài liệu về MatDatepicker và MatMomentDateModule, sau đó xem xét issue #7167 liên quan để tìm hiểu các thảo luận hiện có về múi giờ. Ghi lại một cách rõ ràng, được hỗ trợ để lấy ngày không phụ thuộc múi giờ hoặc ngày UTC, bao gồm cả hành vi dự kiến đối với các giá trị moment; issue được hoàn tất khi người dùng có thể làm theo hướng dẫn mà không phải dựa vào các bình luận rải rác trong issue.

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
documentation, frontend
Loại issue
Tài liệu
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
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.