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

Strict mode with without requiring spaces? #4324

Closed
n9 opened this issue Nov 27, 2017 · 4 comments
Closed

Strict mode with without requiring spaces? #4324

n9 opened this issue Nov 27, 2017 · 4 comments

Comments

@n9
Copy link

n9 commented Nov 27, 2017

Some locales contain spaces in its formats. For instance, in cs (D. M. YYYY) spaces were added because it is in cs.wikipedia style.

This causes problems when parsing user input in these locales, people tends to write 1.2.2017 instead of 1. 2. 2017.

What about to add an option to not require spaces in strict mode parsing?

@marwahaha
Copy link
Member

@ichernev

@petrbela
Copy link
Contributor

For a little bit more context, the norm ČSN 01 6910 allows either 23. 2. 2016 (with spaces) or 23.02.2016 (with padded 0 without spaces). It's currently implemented so that format('l') produces the former, and format('L') the latter. It's true, however, that a lot of people use the incorrect form 23.2.2016.

@ivosh
Copy link

ivosh commented Jun 21, 2018

Agreed with @petrbela. Unfortunately, the incorrect form 23.2.2016 is widespread in administration, though.

@ichernev
Copy link
Contributor

You could use localeConfig.preparese to tweak the input so it passes strict. Use updateLocale to patch the relevant locales for you locally.

I'm reluctant to merge this in core.

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

No branches or pull requests

5 participants