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

moment('xx-2001','MM-YYYY').isValid() should be false #434

Closed
pgn-vole opened this issue Sep 11, 2012 · 4 comments
Closed

moment('xx-2001','MM-YYYY').isValid() should be false #434

pgn-vole opened this issue Sep 11, 2012 · 4 comments
Labels

Comments

@pgn-vole
Copy link

Hi, I have some issues with the .isValid() function.
You can find 2 example below :

moment("xx-xx-2001",'DD-MM-YYY').isValid()  => true
moment("12-13-2001",['DD-MMM-YYY','DD-MM-YYY']).isValid()  => true

These dates are clearly not valid but it still return true.
Is it the wanted behaviour of the isValid() function?

@timrwood
Copy link
Member

The second issue is fixed in #430, and I'll add tests for the first issue

@timrwood
Copy link
Member

The commit above adds passing tests to fix this.

@pgn-vole
Copy link
Author

Thanks, it works perfectly now :)

@timrwood
Copy link
Member

timrwood commented Oct 1, 2012

This has been released with 1.7.1. #384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants