]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix meridiem isUpper/isLower params to match docs
authorRocky Meza <rocky@fusionbox.com>
Sun, 10 Jun 2012 18:36:10 +0000 (12:36 -0600)
committerRocky Meza <rocky@fusionbox.com>
Sun, 10 Jun 2012 18:36:10 +0000 (12:36 -0600)
There were no tests ensuring that this worked before.  Now, the English
language definition relies on isUpper/isLower.  I think this should be a
good enough test of this.

lang/zh-cn.js
moment.js

index 10fad206d9224bbffca4a6e538e9d29d08200780..7ff88a19fd811579e62f2be2ee05e659415e4d94 100644 (file)
@@ -15,7 +15,7 @@
                 LLL : "YYYY年MMMD日LT",
                 LLLL : "YYYY年MMMD日ddddLT"
             },
-            meridiem : function (hour, minute, isUpper) {
+            meridiem : function (hour, minute, isLower) {
                 if (hour < 9) {
                     return "早上";
                 } else if (hour < 11 && minute < 30) {
index bfe89bc221b4daa8582af32c701fa7c71929f707..3be21d1b3221ba21752220c365bd8e4ffef9769d 100644 (file)
--- a/moment.js
+++ b/moment.js
             w    : '(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))',
             YY   : 'p(t.year()%100,2)',
             YYYY : 't.year()',
-            a    : 'm(t.hours(),t.minutes(),!1)',
-            A    : 'm(t.hours(),t.minutes(),!0)',
+            a    : 'm(t.hours(),t.minutes(),!0)',
+            A    : 'm(t.hours(),t.minutes(),!1)',
             H    : 't.hours()',
             h    : 't.hours()%12||12',
             m    : 't.minutes()',
             LLL : "MMMM D YYYY LT",
             LLLL : "dddd, MMMM D YYYY LT"
         },
-        meridiem : function (hours, minutes, isUpper) {
+        meridiem : function (hours, minutes, isLower) {
             if (hours > 11) {
-                return isUpper ? 'PM' : 'pm';
+                return isLower ? 'pm' : 'PM';
             } else {
-                return isUpper ? 'AM' : 'am';
+                return isLower ? 'am' : 'AM';
             }
         },
         calendar : {