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

Invalid date in ar-sa locale #6100

Open
zgeist opened this issue Feb 13, 2023 · 0 comments
Open

Invalid date in ar-sa locale #6100

zgeist opened this issue Feb 13, 2023 · 0 comments

Comments

@zgeist
Copy link

zgeist commented Feb 13, 2023

Describe the bug
Use ar-sa locale in moment. If use arabic date with ١٢٣٤٥٦٧٨٩٠ number date going to invalid.

To Reproduce
Set ar-sa locale

const testDate = '٧ فبراير ٢٠٢٣ ، ٢:٠٠ م';
moment.locale('ar-sa');

const momentInst = moment(testDate);

console.log(momentInst.isValid());  // return false

Expected behavior
Date might be valid

Additional context
It look like need convert also month name and etc. to en locale. Always put en date to moment.
https://github.com/moment/moment/blob/develop/locale/ar-sa.js#L96

Maybe authors arabic locale know this issue
@marwahaha @ichernev

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

1 participant