Skip to content

datepicker doesn't open to correct month for non US date format #5665

Closed
@drewzo

Description

@drewzo

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When reopening the date-picker, it should always open on the selected month

What is the current behavior?

If a date can be parsed as mm/dd/yyyy it will open at the month in that format, even if though it has correctly parsed the date and has the correct date highlighted if you scroll to the correct month

What are the steps to reproduce?

  1. Select a date with the date picker that can be parsed as mm/dd/yyyy e.g. 10th July 2017 (10/07/2017).

image

image

  1. Re-open the date picker, see that it is open on October, not July.

image

  1. Scroll to July and see that the correct date is highlighted, so date picker has correctly parsed the date at some point, just not when deciding which month to open.

image

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U
This behaviour can be seen in the angular material examples: https://material.angular.io/components/datepicker/examples

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

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

angular 4.2.4
material 2.0.0-beta.8
Windows 10, Chrome 59.0.3071.115
TS 2.4.1

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions