]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Vietnamese: added meridiem, fixes #1747
authorAndre Polykanine A.K.A. Menelion Elensúlë <andre@oire.org>
Thu, 25 Feb 2016 23:51:01 +0000 (01:51 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 6 Mar 2016 08:37:34 +0000 (00:37 -0800)
src/locale/vi.js
src/test/locale/vi.js

index 0fafda762e366ecec8f5e6b0054223dd5eb6ce4c..3888345cc2d4514ff77af8610cedc36ceb727c2e 100644 (file)
@@ -10,6 +10,17 @@ export default moment.defineLocale('vi', {
     weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
     weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
     weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
+    meridiemParse: /sa|ch/i,
+    isPM : function (input) {
+        return /^ch$/i.test(input);
+    },
+    meridiem : function (hours, minutes, isLower) {
+        if (hours < 12) {
+            return isLower ? 'sa' : 'SA';
+        } else {
+            return isLower ? 'ch' : 'CH';
+        }
+    },
     longDateFormat : {
         LT : 'HH:mm',
         LTS : 'HH:mm:ss',
index b3f0b84a13998b47b9be45f360828c5424b53572..baeecdd8754ecf9200860ff01708954fe7ddfca2 100644 (file)
@@ -25,8 +25,8 @@ test('parse', function (assert) {
 
 test('format', function (assert) {
     var a = [
-            ['dddd, MMMM Do YYYY, h:mm:ss a',      'chủ nhật, tháng 2 14 2010, 3:25:50 pm'],
-            ['ddd, hA',                            'CN, 3PM'],
+            ['dddd, MMMM Do YYYY, h:mm:ss a',      'chủ nhật, tháng 2 14 2010, 3:25:50 ch'],
+            ['ddd, hA',                            'CN, 3CH'],
             ['M Mo MM MMMM MMM',                   '2 2 02 tháng 2 Th02'],
             ['YYYY YY',                            '2010 10'],
             ['D Do DD',                            '14 14 14'],
@@ -37,7 +37,7 @@ test('format', function (assert) {
             ['H HH',                               '15 15'],
             ['m mm',                               '25 25'],
             ['s ss',                               '50 50'],
-            ['a A',                                'pm PM'],
+            ['a A',                                'ch CH'],
             ['[ngày thứ] DDDo [của năm]',          'ngày thứ 45 của năm'],
             ['LTS',                                '15:25:50'],
             ['L',                                  '14/02/2010'],