From 4af458b11af764367c846660e8c13b9b3f483a6a Mon Sep 17 00:00:00 2001 From: pimterry Date: Sun, 15 Dec 2013 17:50:56 +0000 Subject: [PATCH] Add test for parseZone TZ inference case --- test/moment/zones.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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"); -- 2.47.2