#6100·moment

Invalid date in `ar-sa` locale

Author: zgeistCreated Feb 13, 2023Updated Aug 30, 2024

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