From: Tim Wood Date: Mon, 3 Jun 2013 18:39:15 +0000 (-0700) Subject: #788 add tests for year first array X-Git-Tag: 2.1.0~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71b0f65800cc9094f720705182cf419e29112bb3;p=thirdparty%2Fmoment.git #788 add tests for year first array --- diff --git a/test/moment/create.js b/test/moment/create.js index e48fe6a05..2290fb41d 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -248,7 +248,7 @@ exports.create = { }, "string with array of formats" : function(test) { - test.expect(12); + test.expect(14); test.equal(moment('11-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '11 02 1999', 'switching month and day'); test.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last'); @@ -256,6 +256,8 @@ exports.create = { test.equal(moment('02-11-1999', ['MM/DD/YYYY', 'YYYY-MM-DD']).format('MM DD YYYY'), '02 11 1999', 'year last'); test.equal(moment('1999-02-11', ['MM/DD/YYYY', 'YYYY-MM-DD']).format('MM DD YYYY'), '02 11 1999', 'year first'); + test.equal(moment('02-11-1999', ['YYYY-MM-DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year last'); + test.equal(moment('1999-02-11', ['YYYY-MM-DD', 'MM/DD/YYYY']).format('MM DD YYYY'), '02 11 1999', 'year first'); test.equal(moment('13-11-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'second must be month'); test.equal(moment('11-13-1999', ['MM/DD/YYYY', 'DD/MM/YYYY']).format('MM DD YYYY'), '11 13 1999', 'first must be month');