test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '٢ ٠٢ ٢', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '٣ ٠٣ ٣', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-nci', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-üncü', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-і', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-і', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-ри', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '২ ০২ ২', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '৩ ০৩ ৩', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '༢ ༠༢ ༢', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '༣ ༠༣ ༣', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(start.from(moment([2007, 1, 28]).add({y: 148}), true), '148 vloaz', 'mutation 148 years');
test.equal(start.from(moment([2007, 1, 28]).add({y: 261}), true), '261 bloaz', 'mutation 261 years');
test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
+ test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-мĕш', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-мĕш', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2il', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2il', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2η', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2η', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testStr;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testStr = moment(ordinalStr, 'YYYY MM Do').format('YYYY MM D');
+ test.equal(testStr, '2014 01 ' + i, 'lenient ordinal parsing ' + i);
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testStr;
+ for (i = 1; i <= 31; ++i) {
+ testStr = moment('2014 01 ' + i, 'YYYY MM Do').format('YYYY MM D');
+ test.equal(testStr, '2014 01 ' + i,
+ 'lenient ordinal parsing of number ' + i);
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MMM Do');
+ testMoment = moment(ordinalStr, 'YYYY MMM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
+
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2nd', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3rd', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2a', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3a', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '۲ ۰۲ ۲م', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '۳ ۰۳ ۳م', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3º', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-րդ', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-րդ', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 მე-2', 'იან 8 2012 უნდა იყოს კვირა 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 მე-3', 'იან 9 2012 უნდა იყოს კვირა 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2일', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3일', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(m.calendar(), m.format(datestring), 'Today + ' + i + ' days end of day');
}
test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
+ test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2-oji', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2-oji', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-ри', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-ти', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '२ ०२ २', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '३ ०३ ३', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 sepatutnya minggu 3');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 sepatutnya minggu 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '၂ ၀၂ ၂', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '२ ०२ २', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '३ ०३ ३', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2de', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2de', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2º', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2º', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-я', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-я', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2.', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2.', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2.', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3.', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2a', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2011, 2, 23, 19, 30]).format('a'), ' மாலை', 'late evening');
test.equal(moment([2011, 2, 23, 21, 20]).format('a'), ' இரவு', 'night');
test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
+ test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2', 'Jan 14 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2\'nci', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3\'üncü', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 13]).format('w ww wo'), '2 02 2', 'Jan 13 2012 should be week 2');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '3 03 3', 'Jan 14 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2-й', 'Jan 8 2012 should be week 2');
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3-й', 'Jan 9 2012 should be week 3');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '3 03 3', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2', 'Jan 9 2012 should be week 2');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2', 'Jan 15 2012 should be week 2');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1周', 'Jan 7 2012 应该是第 1周');
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2周', 'Jan 14 2012 应该是第 2周');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};
test.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2週', 'Jan 14 2012 應該是第 2週');
test.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3週', 'Jan 15 2012 應該是第 3週');
+ test.done();
+ },
+
+ 'lenient ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'lenient ordinal parsing of number' : function (test) {
+ var i, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ testMoment = moment('2014 01 ' + i, 'YYYY MM Do');
+ test.equal(testMoment.year(), 2014,
+ 'lenient ordinal parsing of number ' + i + ' year check');
+ test.equal(testMoment.month(), 0,
+ 'lenient ordinal parsing of number ' + i + ' month check');
+ test.equal(testMoment.date(), i,
+ 'lenient ordinal parsing of number ' + i + ' date check');
+ }
+ test.done();
+ },
+
+ 'strict ordinal parsing' : function (test) {
+ var i, ordinalStr, testMoment;
+ for (i = 1; i <= 31; ++i) {
+ ordinalStr = moment([2014, 0, i]).format('YYYY MM Do');
+ testMoment = moment(ordinalStr, 'YYYY MM Do', true);
+ test.ok(testMoment.isValid(), 'strict ordinal parsing ' + i);
+ }
test.done();
}
};