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

Issue with parsing values in Japanese #1806

Closed
pankajupadhyay29 opened this issue May 26, 2020 · 1 comment · Fixed by #1807
Closed

Issue with parsing values in Japanese #1806

pankajupadhyay29 opened this issue May 26, 2020 · 1 comment · Fixed by #1807

Comments

@pankajupadhyay29
Copy link
Contributor

pankajupadhyay29 commented May 26, 2020

Tried parsing Japanese date but it is not working correctly

parse('6日 11月 2025', 'do MMMM yyyy', new Date(), {locale: ja}); 
// Expected: 2025-11-06T00:00:00.000Z
// Received: 2025-01-06T00:00:00.000Z  

same happening with dd/MMM/yy

parse('06/12月/33', 'dd/MMM/yy', new Date(), {locale: ja}); 
// Expected: 2033-12-06T00:00:00.000Z
// Received: 2033-01-06T00:00:00.000Z

It returns 01 form October(10), November(11), December(12), however format is working correctlly

format(new Date(2033, 11, 6), 'dd/MMM/yy', {locale: ja});
//  06/12月/33

This is running on jest tests (node environment)

@pankajupadhyay29
Copy link
Contributor Author

After further debugging, I found that it is due to months match RegEx. PR raised for the fixed #1807.

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

Successfully merging a pull request may close this issue.

1 participant