]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add tests 1651/head
authorIskren Chernev <iskren.chernev@gmail.com>
Sat, 10 May 2014 16:18:12 +0000 (09:18 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 10 May 2014 16:18:12 +0000 (09:18 -0700)
test/moment/create.js

index a96f016e925546bee61179d4f5af36df2dd091dc..9947d485614a74e48285d952ab9d064b53350684 100644 (file)
@@ -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');