Skip to content

datepicker bugs when Primary language is different from the Region #5492

Closed
@BaimosTechnologies

Description

@BaimosTechnologies

Bug, feature request, or proposal:

Bug when the OS Primary language (English) is different from the Region (Germany)

  1. The date object value is: "Tue Jul 04 2017 00:00:00 GMT+0200 (CEST)" - OK
  2. It is is formatted in the input as: "04/07/2017" - Bug
  3. When opening the datepicker it shows the month APR 2017 - Bug
  4. In the datepicker the selected date is 4th of JUL 2017 - OK

What is the expected behavior?

  1. Date should be formatted as: "07/04/2017"
  2. When opening the datepicker it should show the month JUL 2017

What is the current behavior?

Bad formatting, and wrong month shown when opening the datepicker like this:
screen shot 2017-07-04 at 17 48 51

What are the steps to reproduce?

On MacOS goto Language & Region preferences -> Set English - Primary -> Select Region: Germany, like this:
screen shot 2017-07-04 at 18 24 43

Open Plunker template: https://plnkr.co/edit/29fGaJ8uUQNsYoWDeXk4?p=preview

Just select a date in the datepicker, it will be wrongly formatted and you will get the above behavior.

If you then match the Deutsch - Primary to the Region: Germany region all is OK. Same for English - Primary to the Region: United States, but not when you mix them up like above.

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

Datepicker should consistently work with the system formats, also when Language doesn't match the region.

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

"@angular/core": "^4.2.3",
"@angular/material": "2.0.0-beta.7":
"typescript": "2.3.4"
MacOS Sierra
Chrome, Firefox, Safari

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