Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:moment/moment into fix-trailing-z
Browse files Browse the repository at this point in the history
  • Loading branch information
icambron committed Oct 14, 2013
2 parents a50a5e9 + 6b2784c commit d7c134a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions test/lang/zh-cn.js
Expand Up @@ -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;
}
Expand All @@ -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();
},
Expand Down Expand Up @@ -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();
}
};
3 changes: 1 addition & 2 deletions test/moment/create.js
Expand Up @@ -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();
},

Expand Down

0 comments on commit d7c134a

Please sign in to comment.