]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Failing tests for iso week format tokens
authorTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 21:06:42 +0000 (13:06 -0800)
committerTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 21:06:42 +0000 (13:06 -0800)
test/moment/weeks.js

index d774078b4a2b42e49accfde42ae2f083ce75f391..d262a5e6e5be49f00da808d6c36d209b260fff0e 100644 (file)
@@ -112,6 +112,18 @@ exports.utc = {
         test.equal(moment([2011,  0,  9]).isoWeek(),  1, "Jan  9 2011 should be iso week 1");
         test.equal(moment([2011,  0, 10]).isoWeek(),  2, "Jan 10 2011 should be iso week 2");
 
+        test.done();
+    },
+
+    "iso weeks year starting sunday formatted" : function(test) {
+        test.expect(5);
+
+        test.equal(moment([2012, 0,  1]).format('W WW Wo'), '52 52 52nd', "Jan  1 2012 should be iso week 52");
+        test.equal(moment([2012, 0,  2]).format('W WW Wo'),  '1 01 1st' , "Jan  2 2012 should be iso week 1");
+        test.equal(moment([2012, 0,  8]).format('W WW Wo'),  '1 01 1st' , "Jan  8 2012 should be iso week 1");
+        test.equal(moment([2012, 0,  9]).format('W WW Wo'),  '2 02 2nd' , "Jan  9 2012 should be iso week 2");
+        test.equal(moment([2012, 0, 15]).format('W WW Wo'),  '2 02 2nd' , "Jan 15 2012 should be iso week 2");
+
         test.done();
     }
 };