From: Kunal Marwaha Date: Wed, 17 Jun 2020 09:57:49 +0000 (-0700) Subject: Fix tests X-Git-Tag: 2.30.0~20^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dde3393162ce22d0440c17ffec15db91514971bb;p=thirdparty%2Fmoment.git Fix tests --- diff --git a/src/locale/ar-ps.js b/src/locale/ar-ps.js index 4f4112481..edd8be08c 100644 --- a/src/locale/ar-ps.js +++ b/src/locale/ar-ps.js @@ -85,9 +85,18 @@ export default moment.defineLocale('ar-ps', { }, preparse: function (string) { return string - .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { + .replace(/[٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }) + .split('') // reversed since negative lookbehind not supported everywhere + .reverse() + .join('') + .replace(/[١٢](?![\u062a\u0643])/g, function (match) { + return numberMap[match]; + }) + .split('') + .reverse() + .join('') .replace(/،/g, ','); }, postformat: function (string) {