Skip to content

[MomentDateAdapter] "useUtc" no effect for parsing #12023

@hanyu-natsu

Description

@hanyu-natsu

Bug, feature request, or proposal:

MatDatepickerInput does not take care of "useUtc" option when parsing dates.

What is the expected behavior?

When "useUtc" is enabled, dates are created using moment.utc

What is the current behavior?

_isUTC = false

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

https://stackblitz.com/edit/adapter-use-utc-parsing-issue

What is the use-case or motivation for changing an existing behavior?

User input is not correct parsed as UTC moment objects when UTC is wanted.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 6.0.0+
material 6.3.2+

Is there anything else we should know?

Focus on:
https://github.com/angular/material2/blob/9a85b9ba74e3f3715e85b7b94019403290c67742/src/material-moment-adapter/adapter/moment-date-adapter.ts#L180-L185

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions