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

day / time validation #11

Closed
dwoske opened this issue Jan 13, 2017 · 3 comments
Closed

day / time validation #11

dwoske opened this issue Jan 13, 2017 · 3 comments

Comments

@dwoske
Copy link

dwoske commented Jan 13, 2017

Suggest adding Date / Time validation rules, with a way to specify the format of the date, perhaps copy the https://golang.org/pkg/time/#Time.Format layout.

@qiangxue
Copy link
Member

Are you looking for a string validator? Will regex rule work for you?

@qiangxue
Copy link
Member

Or are you looking for a rule that validates the range of a date?

@dwoske
Copy link
Author

dwoske commented Jan 15, 2017

I suppose a regex can work.. something along these lines http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ .. lots of other versions of a date regex about as well.

But, actually, as I think more - a real date parser should be used, as it's not really possible to determine that 2016-02-31 is not a valid date.

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

2 participants