Skip to content

md-datepicker does not respect locale on manual input #5792

@adoris

Description

@adoris

Bug, feature request, or proposal:

Bug

What is the expected behavior?

if german locale set - input date typed from keyboard must recognized in local format ("dd.mm.yyyy").

What is the current behavior?

if date selected by mouse - right date in right format will be diaplayed (german locale - displayed 21.07.2017).
If date will be typed from keyboard - "21.07.2017" - date will not be accepted.
If date will be typed from keyboard - "07/21/2017" - date will be accepted.
Input date will be accepted only in "mm/dd/yyyy" format, not in "dd.mm.yyyy".

What are the steps to reproduce?

here is a sample with locale "de-DE":
https://plnkr.co/edit/FNdibHY1y77mXrSiMTfL

  1. select date "01.juli.2017" from calender: "1.7.2017" will be showed in input control, "1.7.2017" set to bound variable.
  2. change date to "21.07.2017" with keyboard by adding 2 to the beginning of string: null will be set to bound variable.
  3. change date to "07/21/2017" with keyboard: "07/21/2017" will be showed in input control, "21.07.2017" will be set to bound variable.
  4. change date to "07.28.2017" with keyboard: "28.7.2017" will be showed in input control, null will be set to bound variable.

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

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

@angular/core 4.3.0 @angular/material 2.0.0 beta8

Is there anything else we should know?

Metadata

Metadata

Assignees

No one assigned

    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