Skip to content

Datepicker not validating to a valid date #4978

@neekers

Description

@neekers

Bug, feature request, or proposal:

When entering in any other valid besides a date doesn't produce an error

What is the expected behavior?

Should get a date format error triggered or the valid property of the control should be false

What is the current behavior?

Input field accepts anything. Number, string, date. No error is produced and the value of the control is null. Hard to distinguish between bad entry and no entry.

What are the steps to reproduce?

http://plnkr.co/edit/iOMoGgZdk4ljJNz8vpSM?p=preview

  • Create a date picker with no min date requirements.
  • Enter in a plain number "5000"
  • Blur field
  • No error is shown

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

A date field should validate for a real date

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

Angular 4.0.0
Angular Material Design 2.0.0-beta.6
All browsers and OS.

Is there anything else we should know?

Looks like the input is reading the numbers as the year. lol.
screenshot 2017-06-05 14 04 33

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