From: Tim Wood Date: Fri, 9 Dec 2011 17:27:16 +0000 (+0200) Subject: Fixing #92 X-Git-Tag: 1.3.0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aa2857fa4b22b207783f2f1f7082a8a2a6f796c;p=thirdparty%2Fmoment.git Fixing #92 --- diff --git a/moment.js b/moment.js index 0cce77f36..d2da69003 100644 --- a/moment.js +++ b/moment.js @@ -293,7 +293,7 @@ inArray[3] += 12; } // if is 12 am, change hours to 0 - if (! isPm && inArray[3] === 12) { + if (isPm === false && inArray[3] === 12) { inArray[3] = 0; } // handle timezone diff --git a/sitesrc/js/unit-tests.js b/sitesrc/js/unit-tests.js index da8d63f0d..ea73b5100 100755 --- a/sitesrc/js/unit-tests.js +++ b/sitesrc/js/unit-tests.js @@ -58,7 +58,7 @@ test("string without format", 2, function() { }); -test("string with format", 17, function() { +test("string with format", 18, function() { var a = [ ['MM-DD-YYYY', '12-02-1999'], ['DD-MM-YYYY', '12-02-1999'], @@ -75,6 +75,7 @@ test("string with format", 17, function() { ['h:mm a', '12:30 pm'], ['h:mm a', '12:00 am'], ['h:mm a', '12:30 am'], + ['HH:mm', '12:00'], ['YYYY-MM-DDTHH:mm:ss', '2011-11-11T11:11:11'], ['MM-DD-YYYY \\M', '12-02-1999 M'] ],