From d4666fe62cb5b483a69cb7647c1d6a3ed161bf2d Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Mon, 14 Oct 2013 00:30:41 -0700 Subject: [PATCH 1/2] Another breaking test because of stricter iso parser This time there is am added at the end, which was never parsed as part of iso format, so if it was pm it would result in a wrong parse. Deleting this test. Docs don't say this is possible, right :) --- test/moment/create.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/moment/create.js b/test/moment/create.js index fc0da3dfdc..ab098a83aa 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -112,10 +112,9 @@ exports.create = { }, "string without format" : function (test) { - test.expect(3); + test.expect(2); test.ok(moment("Aug 9, 1995").toDate() instanceof Date, "Aug 9, 1995"); test.ok(moment("Mon, 25 Dec 1995 13:30:00 GMT").toDate() instanceof Date, "Mon, 25 Dec 1995 13:30:00 GMT"); - test.equal(new Date(2013, 8, 13, 7, 26).valueOf(), moment("2013-09-13 7:26 am").valueOf(), "2013-09-13 7:26 am"); test.done(); }, From 5381e2f0b51b89c5edd4ceedb33d4de063f32448 Mon Sep 17 00:00:00 2001 From: Zeno Zeng Date: Mon, 14 Oct 2013 22:42:03 +0800 Subject: [PATCH 2/2] Fixes #1184 --- test/lang/zh-cn.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lang/zh-cn.js b/test/lang/zh-cn.js index a15694fbfe..bd3a0b9880 100644 --- a/test/lang/zh-cn.js +++ b/test/lang/zh-cn.js @@ -196,8 +196,8 @@ exports["lang:zh-cn"] = { var i, m, today = moment().startOf('day'); - for (i = 2; i < 7; i++) { - m = moment().startOf('day').add({ d: i}); + for (i = 7; i < 14; i++) { + m = moment().startOf('week').add({ d: i}); if (Math.abs(m.diff(today, 'days')) >= 7) { continue; } @@ -212,10 +212,10 @@ exports["lang:zh-cn"] = { for (i = 1; i < 8; i++) { m = moment().startOf('week').subtract({ d: i}); - if (Math.abs(m.diff(today, 'days')) >= 7) { + if ((Math.abs(m.diff(today, 'days')) >= 7) || (Math.abs(m.diff(today, 'days')) <= 1)) { continue; } - test.equal(m.calendar(), m.format('[上]ddd凌晨12点整'), "Monday - " + i + " days next week"); + test.equal(m.calendar(), m.format('[上]ddd凌晨12点整'), "Monday - " + i + " days next week"); } test.done(); }, @@ -343,12 +343,12 @@ exports["lang:zh-cn"] = { test.done(); }, - + "returns the name of the language" : function (test) { if (typeof module !== 'undefined' && module.exports) { test.equal(require('../../lang/zh-cn'), 'zh-cn', "module should export zh-cn"); } - + test.done(); } };