Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Date string input validation #6881

Open
adamzuckerman opened this issue Mar 27, 2014 · 4 comments
Open

Date string input validation #6881

adamzuckerman opened this issue Mar 27, 2014 · 4 comments

Comments

@adamzuckerman
Copy link

Using the input type="date" tag, the date validates as true when any numeric value that follows the date format of yyyy-MM-dd is typed into the input control. Dates of 0000-00-00 and 9999-99-99 are marked as valid dates. An example test page is http://docs.angularjs.org/api/ng/input/input%5Bdate%5D. This is occurring on FireFox, IE 9 and IE10. I do not have IE11 to test this on.

@Narretz Narretz added this to the 1.3.0 milestone Jul 4, 2014
@Narretz
Copy link
Contributor

Narretz commented Jul 4, 2014

This is currently expected behavior, because javascript Date() will figure out the correct date: 1999-32-01 becomes 1999-02-01. However, I think there should be a way force valid sisplay dates. In the meantime, you could write your own directive that parses the input before date and filters these strings.

@Narretz Narretz changed the title Date input validation Date string input validation Jul 7, 2014
@btford btford removed the gh: issue label Aug 20, 2014
@edgardbg1
Copy link

If this is the expected behavior, so what about chrome. Is it wrong?

@Narretz
Copy link
Contributor

Narretz commented Aug 29, 2014

@edgardbg1 What do you mean "what about Chrome"? Is Chrome doing something different than other browsers?

@IgorMinar
Copy link
Contributor

firefox and ie doesn't support input[date], so that's why the behavior is different.

@IgorMinar IgorMinar modified the milestones: Backlog, 1.3.0 Oct 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants