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

Add exceptional case for isDate #566

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

KisukPark
Copy link
Contributor

@KisukPark KisukPark commented Aug 17, 2016

@chriso

Hi, I just found that isDate() returns false with '2016-02-20T16:23:48.5'

It is because...
dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^:\d]|$)/g);
matches '-20T' and fails.

There was similar case '2010-02-18T16:23:48.5'
In this case, the regex matches nothing.

So, I add T in the regex to match nth for the exceptional case.
dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^T:\d]|$)/g);

Please feedback me whether I did right or not.
Thanks.

  • Kisuk

@coveralls
Copy link

coveralls commented Aug 17, 2016

Coverage Status

Coverage remained the same at 99.103% when pulling ff4a713 on KisukPark:isdate-exceptional into a8b3eba on chriso:master.

@KisukPark
Copy link
Contributor Author

There was an build fail when exec babel-node build-browser && npm run minify which is not related with my changes.
Please check.

Thanks.

@chriso
Copy link
Collaborator

chriso commented Sep 1, 2016

Thanks. The Travis errors have been fixed in master.

@chriso chriso merged commit 7eaad70 into validatorjs:master Sep 1, 2016
chriso added a commit that referenced this pull request Sep 1, 2016
@KisukPark
Copy link
Contributor Author

Thanks!!

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

Successfully merging this pull request may close these issues.

3 participants