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

Make dots other punctuation optional in fromString #35

Closed
icambron opened this issue Oct 20, 2017 · 1 comment
Closed

Make dots other punctuation optional in fromString #35

icambron opened this issue Oct 20, 2017 · 1 comment

Comments

@icambron
Copy link
Member

DateTime.fromString is very picky about parsing. A month name has to exactly match what Luxon expects:

DateTime.fromString('févr.', 'MMM', { locale: 'fr'}).isValid //=> true
DateTime.fromString('Févr.', 'MMM', { locale: 'fr'}).isValid //=> true
DateTime.fromString('fevr.', 'MMM', { locale: 'fr'}).isValid //=> false
DateTime.fromString('févr', 'MMM', { locale: 'fr'}).isValid //=> false

I'm not sure how to desensitize the accents (or if that is even desirable), but I think the dots ought to be optional. Should be easy enough to inject ? into the regexes before trying them.

@icambron
Copy link
Member Author

The fix for dots is in d1c67b1. Going to ignore other punctuation and accent stuff for now.

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

1 participant