Skip to content

Commit

Permalink
Merge pull request #3504 from willdembinski:development
Browse files Browse the repository at this point in the history
[tests] Fixes #3463, parseZone not handling Z correctly (tests only)
  • Loading branch information
ichernev committed Nov 12, 2016
2 parents fefc7c8 + 9fa4d84 commit f8b4a0e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/test/moment/zones.js
Expand Up @@ -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'
);
Expand Down

0 comments on commit f8b4a0e

Please sign in to comment.