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

French month May 'mai' is not recognized by setLanguage. #249

Open
HistoireDeBabar opened this issue Oct 7, 2015 · 1 comment
Open

French month May 'mai' is not recognized by setLanguage. #249

HistoireDeBabar opened this issue Oct 7, 2015 · 1 comment

Comments

@HistoireDeBabar
Copy link

Example:
Date.i18n.setLanguage('fr-FR');
var date = Date.parse('20 mai 2015');

The month attribute of date defaults to the current month when parsed.

@regevbr
Copy link

regevbr commented Jan 27, 2018

this happens in other languages as well.
The cause seems to be that the normalizer first replaces all month names to english, before parsing the string. Then, the translated month is being captured by other regex that mistakenly translate it.
The fix is to remove the month names normalization.
You can see fix in my fork - https://github.com/regevbr/datejs/tree/v1.0.0-rc4

regevbr added a commit to regevbr/datejs that referenced this issue Jan 27, 2018
regevbr added a commit to regevbr/datejs that referenced this issue Jan 28, 2018
regevbr added a commit to regevbr/datejs that referenced this issue Jan 28, 2018
regevbr added a commit to regevbr/datejs that referenced this issue Feb 5, 2018
…er parsing - need to reset funciton cache on language change
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