From fe610ea79a5d309ec5cc62eb1cb8d1b105b6787e Mon Sep 17 00:00:00 2001 From: Sawood Alam Date: Sun, 4 Dec 2016 12:42:19 -0500 Subject: [PATCH] Added meridiem and formatting improvements --- src/locale/ur.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/locale/ur.js b/src/locale/ur.js index 486046f92..baa29ff8e 100644 --- a/src/locale/ur.js +++ b/src/locale/ur.js @@ -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. -- 2.47.2