From d45f06de4ef873e305e32d3c74c0792595b8f533 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Wed, 27 Nov 2013 01:34:01 -0800 Subject: [PATCH] Add tests for format('ZZ') --- test/moment/zones.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/moment/zones.js b/test/moment/zones.js index 3019b82bb..341c38231 100644 --- a/test/moment/zones.js +++ b/test/moment/zones.js @@ -477,5 +477,16 @@ exports.zones = { test.equal(m.zone(), 13 * 60); test.equal(m.hours(), 0); 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"); + test.equal(moment().zone(-120).format('ZZ'), "+0200", "-120 -> +0200"); + + test.equal(moment().zone(+60).format('ZZ'), "-0100", "+60 -> -0100"); + test.equal(moment().zone(+90).format('ZZ'), "-0130", "+90 -> -0130"); + test.equal(moment().zone(+120).format('ZZ'), "-0200", "+120 -> -0200"); + test.done(); } }; -- 2.47.2