From: Iskren Chernev Date: Wed, 27 Nov 2013 09:34:01 +0000 (-0800) Subject: Add tests for format('ZZ') X-Git-Tag: 2.5.0^2~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d45f06de4ef873e305e32d3c74c0792595b8f533;p=thirdparty%2Fmoment.git Add tests for format('ZZ') --- 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(); } };