From: Will Dembinski Date: Fri, 14 Oct 2016 01:14:15 +0000 (-0700) Subject: Fix for conditional in src/lib/units/offset.js:164 - I interpreted this is as simply... X-Git-Tag: 2.17.0~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fa4d847f4d0ae70ebff014c1b1e93df319e940a;p=thirdparty%2Fmoment.git Fix for conditional in src/lib/units/offset.js:164 - I interpreted this is as simply not catching being a falsy (but assumedly valid) time zone modifier (_tzm?) of 0 --- diff --git a/src/test/moment/zones.js b/src/test/moment/zones.js index 257a25822..785a1dbce 100644 --- a/src/test/moment/zones.js +++ b/src/test/moment/zones.js @@ -461,9 +461,27 @@ test('timezone format', function (assert) { test('parse zone without a timezone', function (assert) { test.expectedDeprecations(); - var m = moment.parseZone('2016-02-01T00:00:00'); + var m1 = moment.parseZone('2016-02-01T00:00:00'); + var m2 = moment.parseZone('2016-02-01T00:00:00Z'); + var m3 = moment.parseZone('2016-02-01T00:00:00+00:00'); //Someone might argue this is not necessary, you could even argue that is wrong being here. + var m4 = moment.parseZone('2016-02-01T00:00:00+0000'); //Someone might argue this is not necessary, you could even argue that is wrong being here. assert.equal( - m.format('M D YYYY HH:mm:ss ZZ'), + m1.format('M D YYYY HH:mm:ss ZZ'), + '2 1 2016 00:00:00 +0000', + 'Not providing a timezone should keep the time and change the zone to 0' + ); + assert.equal( + m2.format('M D YYYY HH:mm:ss ZZ'), + '2 1 2016 00:00:00 +0000', + 'Not providing a timezone should keep the time and change the zone to 0' + ); + assert.equal( + m3.format('M D YYYY HH:mm:ss ZZ'), + '2 1 2016 00:00:00 +0000', + 'Not providing a timezone should keep the time and change the zone to 0' + ); + assert.equal( + m4.format('M D YYYY HH:mm:ss ZZ'), '2 1 2016 00:00:00 +0000', 'Not providing a timezone should keep the time and change the zone to 0' );