]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
adding some tests for zones outside the -12 to +12 range
authorTim Wood <washwithcare@gmail.com>
Fri, 8 Mar 2013 18:42:50 +0000 (10:42 -0800)
committerTim Wood <washwithcare@gmail.com>
Fri, 8 Mar 2013 18:42:50 +0000 (10:42 -0800)
test/moment/zones.js

index 473893f870ae986473327a965e75eee240525af7..9727ee803c029ca2614d228c42973a24a486cfda 100644 (file)
@@ -53,6 +53,9 @@ exports.zones = {
         zone.zone(-30);
         test.equal(zone.format("HH:mm"), "07:01", "UTC 6:31AM should be 7:01AM at +0030");
 
+        zone.zone(1380);
+        test.equal(zone.format("HH:mm"), "07:31", "UTC 6:31AM should be 7:31AM at +1380");
+
         test.done();
     },
 
@@ -60,7 +63,8 @@ exports.zones = {
         var zoneA = moment(),
             zoneB = moment(zoneA),
             zoneC = moment(zoneA),
-            zoneD = moment(zoneA);
+            zoneD = moment(zoneA),
+            zoneE = moment(zoneA);
 
         zoneB.utc();
         test.equal(+zoneA, +zoneB, "moment should equal moment.utc");
@@ -71,6 +75,9 @@ exports.zones = {
         zoneD.zone(480);
         test.equal(+zoneA, +zoneD, "moment should equal moment.zone(480)");
 
+        zoneE.zone(1000);
+        test.equal(+zoneA, +zoneE, "moment should equal moment.zone(1000)");
+
         test.done();
     },