yy : pluralize('y')
},
preparse: function (string) {
- return string.replace(/\u200f/g, '').replace(/،/g, ',');
+ return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
yy : pluralize('y')
},
preparse: function (string) {
- return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
+ return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
-
}
}
});
+
+// locale-specific
+test('ar-ly strict mode parsing works', function (assert) {
+ const m = moment().locale('ar-ly');
+ const formattedDate = m.format('l');
+ assert.equal(moment.utc(formattedDate, 'l', 'ar-ly', false).isValid(), true, 'Non-strict parsing works');
+ assert.equal(moment.utc(formattedDate, 'l', 'ar-ly', true).isValid(), true,'Strict parsing must work');
+});
}
}
});
+
+// locale-specific
+test('ar strict mode parsing works', function (assert) {
+ const m = moment().locale('ar');
+ const formattedDate = m.format('l');
+ assert.equal(moment.utc(formattedDate, 'l', 'ar', false).isValid(), true, 'Non-strict parsing works');
+ assert.equal(moment.utc(formattedDate, 'l', 'ar', true).isValid(), true,'Strict parsing must work');
+});