koorchik/js-livr-extra-rules

"LIVR: wrong date in "min" parametr" for date '1900-01-01'

Opened this issue · 1 comments

Steps to reproduce:

  1. Create rule { 'iso_date': { min: '1900-01-01' } }
  2. Set time zone with negative offset. For example (UTC-01:00).
  3. Perform validation.

Method isDateValid returns false, then library throws exception.
d.setTime( d.getTime() + d.getTimezoneOffset() * 60 * 1000 );
After this row variable 'd' has value "Sun Dec 31 1899 23:59:28 GMT-0154".

Thanks, will check this