From f7b21b15e49ec40672be407729638550c6609a9f Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Sat, 10 May 2014 09:18:12 -0700 Subject: [PATCH] Add tests --- test/moment/create.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/moment/create.js b/test/moment/create.js index a96f016e9..9947d4856 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -348,6 +348,16 @@ exports.create = { test.done(); }, + "string with timezone around start of year" : function (test) { + test.equal(moment('2000-01-01T00:00:00.000+01:00').toISOString(), "1999-12-31T23:00:00.000Z", "+1:00 around 2000"); + test.equal(moment('2000-01-01T00:00:00.000-01:00').toISOString(), "2000-01-01T01:00:00.000Z", "-1:00 around 2000"); + test.equal(moment('1970-01-01T00:00:00.000+01:00').toISOString(), "1969-12-31T23:00:00.000Z", "+1:00 around 1970"); + test.equal(moment('1970-01-01T00:00:00.000-01:00').toISOString(), "1970-01-01T01:00:00.000Z", "-1:00 around 1970"); + test.equal(moment('1200-01-01T00:00:00.000+01:00').toISOString(), "1199-12-31T23:00:00.000Z", "+1:00 around 1200"); + test.equal(moment('1200-01-01T00:00:00.000-01:00').toISOString(), "1200-01-01T01:00:00.000Z", "-1:00 around 1200"); + test.done(); + }, + "string with array of formats" : function (test) { test.equal(moment('11-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '11 02 1999', 'switching month and day'); -- 2.47.2