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

features: validate iso8601 date and datetime #373

Closed
zaggino opened this issue Mar 13, 2015 · 3 comments
Closed

features: validate iso8601 date and datetime #373

zaggino opened this issue Mar 13, 2015 · 3 comments

Comments

@zaggino
Copy link

zaggino commented Mar 13, 2015

please consider providing methods for validating the following:

isoDate: 2015-03-11
isoDateTime: 2015-03-11T13:23:51+00:00 || 2015-03-11T13:23:51Z

ref: http://en.wikipedia.org/wiki/ISO_8601

I currently use this: https://github.com/zaggino/z-schema/blob/master/src/FormatValidators.js#L6-L45 and I'd like to delegate this to your validator if possible since it's referenced for validating emails anyway

@ItalyPaleAle
Copy link
Contributor

Please see http://stackoverflow.com/a/14322189/192024 for a more appropriate regular expression

@chriso
Copy link
Collaborator

chriso commented Mar 14, 2015

Thanks for the request. PRs are welcome :)

@gkaimakas
Copy link
Contributor

That can be done easily using moment.js which supports ISO 8601 but I am not sure if moment.js should be included as a dependency...

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

4 participants