From: pimterry Date: Sun, 15 Dec 2013 17:50:56 +0000 (+0000) Subject: Add test for parseZone TZ inference case X-Git-Tag: 2.5.0^2~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4af458b11af764367c846660e8c13b9b3f483a6a;p=thirdparty%2Fmoment.git Add test for parseZone TZ inference case --- diff --git a/test/moment/zones.js b/test/moment/zones.js index eb638db1d..a497f9d6d 100644 --- a/test/moment/zones.js +++ b/test/moment/zones.js @@ -482,7 +482,7 @@ exports.zones = { test.done(); }, - "parse zone dependent on format string" : function (test) { + "parse zone with a timezone from the format string" : function (test) { test.expect(1); var m = moment("11-12-2013 -0400 +1100", "DD-MM-YYYY ZZ #####").parseZone(); @@ -491,6 +491,15 @@ exports.zones = { test.done(); }, + "parse zone without a timezone included in the format string" : function (test) { + test.expect(1); + + var m = moment("11-12-2013 -0400 +1100", "DD-MM-YYYY").parseZone(); + + test.equal(m.zone(), -11 * 60); + test.done(); + }, + "timezone format" : function (test) { test.equal(moment().zone(-60).format('ZZ'), "+0100", "-60 -> +0100"); test.equal(moment().zone(-90).format('ZZ'), "+0130", "-90 -> +0130");