Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Date if I try validator.isDate(Date()) #422

Closed
felipefdl opened this issue Aug 17, 2015 · 5 comments
Closed

Invalid Date if I try validator.isDate(Date()) #422

felipefdl opened this issue Aug 17, 2015 · 5 comments

Comments

@felipefdl
Copy link

When I try string version
validator.isDate(Date()) // 'Mon Aug 17 2015 00:24:56 GMT-0500 (CDT)
or object version
validator.isDate(new Date()) // Mon Aug 17 2015 00:25:15 GMT-0500 (CDT)

Always return false.

screen shot 2015-08-17 at 12 26 06 am

@addaleax
Copy link
Contributor

I’m not sure I understand the code correctly, but it seems to me that since 4.0.3 .isDate validates the day part of a date only (i.e. “Aug 17”). So maybe this validator could more aptly have been named .isDay instead of replacing the old one…?

Anyway, unlike stated, this will not always return false, but only if at least of one second, minute or hour of the current time start with a 2 or a 3.

@felipefdl
Copy link
Author

I using 3.43.0 version, in my project (and working well). I got that problem when I updated to 4.0.3

@addaleax
Copy link
Contributor

4.0.2 is basically the same as 4.0.3 without #418 merged in. So if this is urgent for you, you can just stick to that version, where .isDate does validate full dates.

@felipefdl
Copy link
Author

It not urgent. It's ok. I'm just reporting. Thank you.

@chriso
Copy link
Collaborator

chriso commented Aug 17, 2015

#418 introduced some regressions. It has been reverted in v4.0.4.

@chriso chriso closed this as completed Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants