angular / angular/components

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

Abierto
#11,027 5 comentarios 8 reacciones 0 asignados Ver en GitHub
area: material/datepicker P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la documentación de MatDatepicker y MatMomentDateModule y, después, revisa el issue #7167 relacionado para consultar la discusión existente sobre zonas horarias. Documenta una forma clara y compatible de obtener fechas independientes de la zona horaria o fechas UTC, incluido el comportamiento esperado para los valores de moment; el issue se considera terminado cuando los usuarios pueden seguir las indicaciones sin depender de comentarios dispersos del issue.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
documentation, frontend
Tipo de issue
Documentación
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.