koorchik / js-livr-extra-rules

More validation rules for LIVR (https://www.npmjs.com/package/livr)
MIT License
15 stars 3 forks source link

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

Open inzagher opened 5 years ago

inzagher commented 5 years ago

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".

koorchik commented 5 years ago

Thanks, will check this