Open manikumarnnss opened 6 years ago
Anyone please help me here...
Please, which version of globalize and cldr are you using? Using latest, it works fine for me. I noticed in your output you have comma ،
instead of colon :
separating hour digits...
I get this instead:
Globalize("ar").formatDate(new Date(2018,10,1,13,27,17), { 'raw': 'yyyy-MM-dd HH:mm:ss' })
// > '٢٠١٨-١١-٠١ ١٣:٢٧:١٧'
Globalize("ar").parseDate('٢٠١٨-١١-٠١ ١٣:٢٧:١٧', { 'raw': 'yyyy-MM-dd HH:mm:ss' })
// > 2018-11-01T16:27:17.000Z
I will reopen when I can reproduce...
By the way, why are you using raw
format like that? I disencourage using raw
for localization purposes, instead use skeleton
or datetime
.
If you want ISO string, use plain JavaScript, e.g., new Date().toISOString()
.
Ok, this is an issue using CLDR 27, because timeSeparator
is ،
instead of :
as in CLDR 28 and up.
Is this lib dead or why is this issue still open? Just a kind question.
Generally Globalize library's parseDate() should always accept the output of its own formatDate(). But this fails for globalize.culture.ar.js.
Globalize.formatDate(new Date(), { 'raw': 'yyyy-MM-dd HH:mm:ss' }) return "٢٠١٨-١١-٠١ ١٣،٢٧،١٧"
Even if we pass the return value from above to parseDate it cant be accepted and retruns 'null'-
Globalize.parseDate("٢٠١٨-١١-٠١ ١٣،٢٧،١٧", { 'raw': 'yyyy-MM-dd HH:mm:ss' }) return nulll