]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Removed forEach from format tests 1219/head
authorIskren Chernev <iskren.chernev@gmail.com>
Fri, 25 Oct 2013 06:36:29 +0000 (23:36 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 26 Oct 2013 05:58:44 +0000 (22:58 -0700)
test/moment/format.js

index 6c3f8c3d0b862ce1d1e006bfc2034c4eaee847f5..c961cca8d135e2168ca7f1104328f4d1062981fd 100644 (file)
@@ -314,14 +314,17 @@ exports.format = {
     "calendar day timezone" : function (test) {
         test.expect(10);
 
+        moment.lang('en');
         var zones = [60, -60, 90, -90, 360, -360, 720, -720],
             b = moment().utc().startOf('day').subtract({ m : 1 }),
-            c = moment().local().startOf('day').subtract({ m : 1 });
+            c = moment().local().startOf('day').subtract({ m : 1 }),
+            i, z, a;
 
-        zones.forEach(function (z) {
-            var a = moment().zone(z).startOf('day').subtract({ m: 1 });
+        for (i = 0; i < zones.length; ++i) {
+            z = zones[i];
+            a = moment().zone(z).startOf('day').subtract({ m: 1 });
             test.equal(moment(a).zone(z).calendar(), "Yesterday at 11:59 PM", "Yesterday at 11:59 PM, not Today, or the wrong time");
-        });
+        }
 
         test.equal(moment(b).utc().calendar(), "Yesterday at 11:59 PM", "Yesterday at 11:59 PM, not Today, or the wrong time");
         test.equal(moment(c).local().calendar(), "Yesterday at 11:59 PM", "Yesterday at 11:59 PM, not Today, or the wrong time");