]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Added meridiem and formatting improvements
authorSawood Alam <ibnesayeed@gmail.com>
Sun, 4 Dec 2016 17:42:19 +0000 (12:42 -0500)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 2 Mar 2017 08:49:52 +0000 (10:49 +0200)
src/locale/ur.js

index 486046f92bbb6c0516d4745a2f893d6d240cc4f8..baa29ff8ecaf6914b8367d2aeada47bb81ebcc1c 100644 (file)
@@ -40,14 +40,24 @@ export default moment.defineLocale('ur', {
         L : 'DD/MM/YYYY',
         LL : 'D MMMM YYYY',
         LLL : 'D MMMM YYYY HH:mm',
-        LLLL : 'dddd D MMMM YYYY HH:mm'
+        LLLL : 'dddd، D MMMM YYYY HH:mm'
+    },
+    meridiemParse: /صبح|شام/,
+    isPM : function (input) {
+        return 'شام' === input;
+    },
+    meridiem : function (hour, minute, isLower) {
+        if (hour < 12) {
+            return 'صبح';
+        }
+        return 'شام';
     },
     calendar : {
         sameDay : '[آج بوقت] LT',
         nextDay : '[کل بوقت] LT',
         nextWeek : 'dddd [بوقت] LT',
         lastDay : '[گذشتہ روز بوقت] LT',
-        lastWeek : '[Ú©ذشتہ] dddd [بوقت] LT',
+        lastWeek : '[Ú¯ذشتہ] dddd [بوقت] LT',
         sameElse : 'L'
     },
     relativeTime : {
@@ -65,6 +75,12 @@ export default moment.defineLocale('ur', {
         y : 'ایک سال',
         yy : '%d سال'
     },
+    preparse: function (string) {
+        return string.replace(/،/g, ',');
+    },
+    postformat: function (string) {
+        return string.replace(/,/g, '،');
+    },
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.