timrwood/moment — Issue #194: Unit test failure: When zone() offset is 0, the ISO offset s/b positive zero
Author: tjcrowder
Created: 2012-03-07 14:27:24+00:00
State: open

Unit test 31 fails for me (I'm in the UK and we're not currently on DST, so our timezone offset is 0):

31. zone 2 passed,1 failed.
When the zone() offset is equal to 0, the ISO offset should be positive zero
AssertionError: When the zone() offset is equal to 0, the ISO offset should be positive zero
at Object.ok (http://momentjs.com/js/tests.js?_=120203_183019:1526:39)
at http://momentjs.com/js/tests.js?_=120203_183019:2464:18
at Object.runTest (http://momentjs.com/js/tests.js?_=120203_183019:1702:9)
at http://momentjs.com/js/tests.js?_=120203_183019:1748:25
at http://momentjs.com/js/tests.js?_=120203_183019:1006:13
at http://momentjs.com/js/tests.js?_=120203_183019:616:13
at http://momentjs.com/js/tests.js?_=120203_183019:627:25
at http://momentjs.com/js/tests.js?_=120203_183019:1008:17
at http://momentjs.com/js/tests.js?_=120203_183019:1589:17
moment.fn.zone should be a multiple of 30 (was 0)
zone should equal getTimezoneOffset

I'm confused by the failure, though, since if I run [this code](http://jsbin.com/elepam):

display("moment().zone() === 0? " +
(moment().zone() === 0));
display("moment().zone() === new Date().getTimezoneOffset()? " +
(moment().zone() === new Date().getTimezoneOffset()));

...both statements show `true`. Looking at [the test](https://github.com/timrwood/moment/blob/master/test/moment/format.js#L73), I don't see why the assertion fails given my test doesn't.