Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Currently, the Validator component's "Date" (link) validator only validates inputs with the format Y-m-d. Whilst this is perfectly fine for general international use, I am finding that client-side a lot of dates are inputted in locale-specific formats, e.g. d-m-Y.

Is there enough interest to add the option to specify the date format? Or, going one-stage further, add the ability to specify an array of valid date formats?

Would you support an option to customise date validation in Validator component?
Yes - Add the ability to override the default `Y-m-d` format
25%
Yes - Add the ability to override the default `Y-m-d` format with an array of formats
25%
No - I think the date validator should stay international and rely on client-side formatting
50%
You must be logged in to vote

Replies: 1 comment · 2 replies

Comment options

No - I think the date validator should stay international and rely on client-side formatting

Y-m-d is considered international format? Any spec reference?

You must be logged in to vote
2 replies
@leberknecht
Comment options

image

@simondeeley
Comment options

Thanks for your thoughts 👍🏻
Just posing the question though that if international formatting wasn't an option, should the validator constraint allow devs the option to override/customise the formatting, e.g. d-m-Y, for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.