mikeerickson / validatorjs

A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
https://www.npmjs.com/package/validatorjs
MIT License
1.77k stars 280 forks source link

Date validation returning unexpected results #187

Closed jeremymlane closed 7 years ago

jeremymlane commented 7 years ago

In version 3.11.0 the string '2017-05-31 20:32:42' would pass date validation as expected, but after updating to 3.12.0, it fails to pass. Any ideas?

mikeerickson commented 7 years ago

@jeremymlane Can you please supply me with a snippet of code you are using. I just tried it locally and seems good here. Just making sure we are comparing correctly

kendepelchin commented 7 years ago

@jeremymlane that is an issue that's already fixed in master, but there is no release yet. See https://github.com/skaterdav85/validatorjs/pull/175

This issue happens only with the last day of the month where the next month does not have that exact day.

@mikeerickson I came back here to create an issue about the npm package. When fetching the last version (3.13.3) the changes from @eugenmueller aren't returned. Is NPM missing some releases? Should I create an issue for this?

mikeerickson commented 7 years ago

@kendepelchin I will get this corrected (it will be bumped to v3.14) There were some incorrect updates pushed to npm (my fault) that need to be corrected. I will get it completed over the weekend.

jeremymlane commented 7 years ago

@kendepelchin @mikeerickson That makes sense. I was wondering if it had something to do with the last day of the month. Thanks for the help!

the-architect commented 7 years ago

Just ran into this issue as well. 31st always fails. Is this fixed on master? Edit: Works on master! 👍

bhanushankar422 commented 7 years ago

When will the npm version of 3.14 will be released which includes this fix?

mikeerickson commented 7 years ago

@bhanushankar422 If all goes as planned, it will be released tomorrow or Wednesday.

bhanushankar422 commented 7 years ago

ok thanks

bhanushankar422 commented 7 years ago

@mikeerickson are there any issues in releasing this fix on npm?

hmbenner commented 7 years ago

@mikeerickson It looks like the fix on master is valid! Can master be released as 3.13.4 or 3.14 so that we can update to the fixed version?

iamdtang commented 7 years ago

I just made a release for 3.13.4.