From: Kunal Marwaha Date: Tue, 21 Feb 2017 07:33:51 +0000 (-0500) Subject: Make suggested fix by @vagsa2 X-Git-Tag: 2.18.0~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b592f68552586b8d81d41afdc290e95355ecacf0;p=thirdparty%2Fmoment.git Make suggested fix by @vagsa2 --- diff --git a/src/test/moment/format.js b/src/test/moment/format.js index 25ea64ba4..195469a78 100644 --- a/src/test/moment/format.js +++ b/src/test/moment/format.js @@ -215,6 +215,13 @@ test('long years', function (assert) { assert.equal(moment.utc().year(-20123).format('YYYYYY'), '-020123', 'big negative year with YYYYYY'); }); +test('toISOString() when 0 year', function (assert) { + // https://github.com/moment/moment/issues/3765 + var date = moment('0000-01-01T21:00:00.000Z'); + assert.equal(date.toISOString(), '0000-01-01T21:00:00.000Z'); + assert.equal(date.toDate().toISOString(), '0000-01-01T21:00:00.000Z'); +}); + test('iso week formats', function (assert) { // https://en.wikipedia.org/wiki/ISO_week_date var cases = {