mootools / mootools-more

MooTools Plugins and Enhancements Repository
http://mootools.net
738 stars 234 forks source link

Form.Validator - validate-date bug in FF4/IE9 #1002

Open tjeerdkramer opened 13 years ago

tjeerdkramer commented 13 years ago

The date validator doesn't work correctly in FF4 and IE9 (no others tested except Chrome, which works)

See: http://jsfiddle.net/LgJsN/1809/

Entering 31/31/2009 results in a validated field, except that the value of the input field changes into "31/07/2011", which is obviously not the same as the (invalid) date input of "31/31/2009".

Also, when entering a valid date (dateFormat:'%d/%m/%Y') such as "31/02/1999" messes things up, as it changes into "02/07/2001"

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/359985-form-validator-validate-date-bug-in-ff4-ie9?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github).
arian commented 13 years ago

It's because Date.parse('31/31/2009') returns Date {Sun Jul 31 2011 00:00:00 GMT+0100 (BST)} in Firefox. Probably that should return an invalid date.

cenobitedk commented 12 years ago

This is related to issue #1034.