From: Rocky Meza Date: Sun, 10 Jun 2012 18:36:10 +0000 (-0600) Subject: Fix meridiem isUpper/isLower params to match docs X-Git-Tag: 1.7.0~22^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce99576dcde4def3eae8f1beaa6b54cf7c3b4ccd;p=thirdparty%2Fmoment.git Fix meridiem isUpper/isLower params to match docs 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. --- diff --git a/lang/zh-cn.js b/lang/zh-cn.js index 10fad206d..7ff88a19f 100644 --- a/lang/zh-cn.js +++ b/lang/zh-cn.js @@ -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) { diff --git a/moment.js b/moment.js index bfe89bc22..3be21d1b3 100644 --- a/moment.js +++ b/moment.js @@ -104,8 +104,8 @@ 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()', @@ -731,11 +731,11 @@ 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 : {