This project is archived and is in readonly mode.

#468 ✓resolved

(Form.)Validator should not use Date.parse for validating

Reported by Arian | December 23rd, 2010 @ 12:43 PM | in

The date validator of Form.Validator uses Date.parse (if it's available).

Instead it should use the Locale.Date files to build a regex which can validate the input.

For example Date.parse('boo 12') returns '01 dec 2010' in Chrome (V8) (because Date.parse falls back to new Date('boo 12'))

Another thing is that Date.parse will parse times correctly, but it's a date validator, not a datetime validator. Just like timestamps,

Maybe another solution would be to add a Date.validate function, so all the Date methods can be used in case we have to duplicate codes.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket