var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "اليوم على الساعة 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "اليوم على الساعة 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "اليوم على الساعة 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "غدا على الساعة 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "اليوم على الساعة 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "أمس على الساعة 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "اليوم على الساعة 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "اليوم على الساعة 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "غدا على الساعة 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "اليوم على الساعة 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "أمس على الساعة 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "اليوم على الساعة ٠٢:٠٠", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "اليوم على الساعة ٠٢:٢٥", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "اليوم على الساعة ٠٣:٠٠", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "غدا على الساعة ٠٢:٠٠", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "اليوم على الساعة ٠١:٠٠", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "أمس على الساعة ٠٢:٠٠", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "اليوم على الساعة ٠٢:٢٥", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "اليوم على الساعة ٠٣:٠٠", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "غدا على الساعة ٠٢:٠٠", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "اليوم على الساعة ٠١:٠٠", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "أمس على الساعة ٠٢:٠٠", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
test.expect(4);
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "اليوم على الساعة ٠٢:٠٠", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "اليوم على الساعة ٠٢:٢٥", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "اليوم على الساعة ٠٣:٠٠", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "غدا على الساعة ٠٢:٠٠", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "اليوم على الساعة ٠١:٠٠", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "أمس على الساعة ٠٢:٠٠", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "اليوم على الساعة ٠٢:٢٥", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "اليوم على الساعة ٠٣:٠٠", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "غدا على الساعة ٠٢:٠٠", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "اليوم على الساعة ٠١:٠٠", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "أمس على الساعة ٠٢:٠٠", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [على الساعة] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "bugün saat 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "bugün saat 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "bugün saat 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "sabah saat 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "bugün saat 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "dünən 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "bugün saat 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "bugün saat 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "sabah saat 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "bugün saat 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "dünən 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[gələn həftə] dddd [saat] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[gələn həftə] dddd [saat] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[keçən həftə] dddd [saat] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[keçən həftə] dddd [saat] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
test.expect(4);
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Днес в 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Днес в 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Днес в 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Утре в 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Днес в 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Днес в 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Днес в 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Утре в 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Днес в 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Вчера в 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [в] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [в] LT'), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
['ll', '১৪ ফেব ২০১০'],
['lll', '১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়'],
['llll', 'রবি, ১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়']
- ],
+ ],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "আজ রাত ২:০০ সময়", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "আজ রাত ২:২৫ সময়", "Now plus 25 min");
- test.equal(moment(a).add({ h: 3 }).calendar(), "আজ শকাল ৫:০০ সময়", "Now plus 3 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "আগামীকাল রাত ২:০০ সময়", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "আজ রাত ১:০০ সময়", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "গতকাল রাত ২:০০ সময়", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "আজ রাত ২:২৫ সময়", "Now plus 25 min");
+ test.equal(moment(a).add({h: 3}).calendar(), "আজ শকাল ৫:০০ সময়", "Now plus 3 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "আগামীকাল রাত ২:০০ সময়", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "আজ রাত ১:০০ সময়", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "গতকাল রাত ২:০০ সময়", "yesterday at the same time");
test.done();
},
"calendar next week" : function (test) {
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[গত] dddd[,] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[গত] dddd[,] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
test.expect(4);
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hiziv da 2e00 AM", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hiziv da 2e25 AM", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hiziv da 3e00 AM", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Warc'hoazh da 2e00 AM", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hiziv da 1e00 AM", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Dec'h da 2e00 AM", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hiziv da 2e25 AM", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hiziv da 3e00 AM", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Warc'hoazh da 2e00 AM", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hiziv da 1e00 AM", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Dec'h da 2e00 AM", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [da] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [da] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [paset da] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [paset da] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
moment.lang('br');
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "danas u 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "danas u 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "danas u 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "sutra u 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "danas u 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "jučer u 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "danas u 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "danas u 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "sutra u 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "danas u 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "jučer u 2:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "avui a les 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "avui a les 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "avui a les 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "demà a les 2:00", "tomorrow at the same time");
- test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "demà a la 1:00", "tomorrow minus 1 hour");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "avui a la 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "ahir a les 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "avui a les 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "avui a les 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "demà a les 2:00", "tomorrow at the same time");
+ test.equal(moment(a).add({d: 1, h : -1}).calendar(), "demà a la 1:00", "tomorrow minus 1 hour");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "avui a la 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "ahir a les 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "dnes v 2.00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "dnes v 2.25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "dnes v 3.00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "zítra v 2.00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "dnes v 1.00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "včera v 2.00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "dnes v 2.25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "dnes v 3.00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "zítra v 2.00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "dnes v 1.00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "včera v 2.00", "yesterday at the same time");
test.done();
},
var i, m, nextDay;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
nextDay = '';
switch (m.day()) {
case 0:
var i, m, lastDay;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
lastDay = '';
switch (m.day()) {
case 0:
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
"calendar day" : function (test) {
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Паян 02:00 сехетре", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Паян 02:25 сехетре", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Паян 03:00 сехетре", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Ыран 02:00 сехетре", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Паян 01:00 сехетре", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ĕнер 02:00 сехетре", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Паян 02:25 сехетре", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Паян 03:00 сехетре", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Ыран 02:00 сехетре", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Паян 01:00 сехетре", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Ĕнер 02:00 сехетре", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[Çитес] dddd LT [сехетре]'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Çитес] dddd LT [сехетре]'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Иртнĕ] dddd LT [сехетре]'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Иртнĕ] dddd LT [сехетре]'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Heddiw am 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Heddiw am 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Heddiw am 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Yfory am 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Heddiw am 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ddoe am 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Heddiw am 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Heddiw am 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Yfory am 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Heddiw am 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Ddoe am 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [am] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [am] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [diwethaf am] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [diwethaf am] LT'), "Today - " + i + " days beginning of day");
},
"same all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Heute um 02:00 Uhr", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Heute um 02:25 Uhr", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Heute um 03:00 Uhr", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 02:00 Uhr", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 01:00 Uhr", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 02:00 Uhr", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Heute um 02:25 Uhr", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Heute um 03:00 Uhr", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Morgen um 02:00 Uhr", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Heute um 01:00 Uhr", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Gestern um 02:00 Uhr", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
"calendar all else": function (test) {
test.expect(4);
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Heute um 02:00 Uhr", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Heute um 02:25 Uhr", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Heute um 03:00 Uhr", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 02:00 Uhr", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 01:00 Uhr", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 02:00 Uhr", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Heute um 02:25 Uhr", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Heute um 03:00 Uhr", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Morgen um 02:00 Uhr", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Heute um 01:00 Uhr", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Gestern um 02:00 Uhr", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Σήμερα στις 2:00 ΠΜ", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Σήμερα στις 2:25 ΠΜ", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Σήμερα στις 3:00 ΠΜ", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Αύριο στις 2:00 ΠΜ", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Σήμερα στη 1:00 ΠΜ", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Χθες στις 2:00 ΠΜ", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Σήμερα στις 2:25 ΠΜ", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Σήμερα στις 3:00 ΠΜ", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Αύριο στις 2:00 ΠΜ", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Σήμερα στη 1:00 ΠΜ", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Χθες στις 2:00 ΠΜ", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [στις] LT'), "Today + " + i + " days beginning of day");
"calendar last week" : function (test) {
- var i, m;
+ var i, m, dayString;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- var dayString = m.day() === 6 ? '[το προηγούμενο Σάββατο]' : '[την προηγούμενη] dddd';
+ m = moment().subtract({d: i});
+ dayString = m.day() === 6 ? '[το προηγούμενο Σάββατο]' : '[την προηγούμενη] dddd';
test.equal(m.calendar(), m.format(dayString + ' [' + (m.hours() % 12 === 1 ? 'στη' : 'στις') + '] LT'), "Today - " + i + " days current time");
m.hours(1).minutes(30).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(dayString + ' [στη] LT'), "Today - " + i + " days one o clock");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Today at 2:25 AM", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Today at 2:25 AM", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Today at 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Today at 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Tomorrow at 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Today at 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Yesterday at 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Today at 2:25 AM", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Last] dddd [at] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
},
"weeks year starting sunday format" : function (test) {
-
test.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1st', "Jan 1 2012 should be week 1");
test.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1st', "Jan 7 2012 should be week 1");
test.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2nd', "Jan 8 2012 should be week 2");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hodiaŭ je 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hodiaŭ je 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hodiaŭ je 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Morgaŭ je 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hodiaŭ je 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hieraŭ je 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hodiaŭ je 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hodiaŭ je 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Morgaŭ je 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hodiaŭ je 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Hieraŭ je 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [je] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [je] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[pasinta] dddd [je] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "hoy a las 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "hoy a las 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "hoy a las 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "mañana a las 2:00", "tomorrow at the same time");
- test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "hoy a la 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "ayer a las 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "hoy a las 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "hoy a las 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "mañana a las 2:00", "tomorrow at the same time");
+ test.equal(moment(a).add({d: 1, h : -1}).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "hoy a la 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "ayer a las 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Täna, 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Täna, 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Täna, 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Homme, 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Täna, 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Eile, 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Täna, 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Täna, 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Homme, 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Täna, 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Eile, 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[Järgmine] dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Järgmine] dddd LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Eelmine] dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Eelmine] dddd LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 nädal tagasi");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "1 nädala pärast");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 nädalat tagasi");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "2 nädala pärast");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "gaur 02:00etan", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "gaur 02:25etan", "now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "gaur 03:00etan", "now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "bihar 02:00etan", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "gaur 01:00etan", "now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "atzo 02:00etan", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "gaur 02:25etan", "now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "gaur 03:00etan", "now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "bihar 02:00etan", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "gaur 01:00etan", "now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "atzo 02:00etan", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "امروز ساعت ۰۲:۰۰", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "امروز ساعت ۰۲:۲۵", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "امروز ساعت ۰۳:۰۰", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "فردا ساعت ۰۲:۰۰", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "امروز ساعت ۰۱:۰۰", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "دیروز ساعت ۰۲:۰۰", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "امروز ساعت ۰۲:۲۵", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "امروز ساعت ۰۳:۰۰", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "فردا ساعت ۰۲:۰۰", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "امروز ساعت ۰۱:۰۰", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "دیروز ساعت ۰۲:۰۰", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [ساعت] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [ساعت] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [پیش ساعت] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "tänään klo 02.00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "tänään klo 02.25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "tänään klo 03.00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "huomenna klo 02.00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "tänään klo 01.00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "eilen klo 02.00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "tänään klo 02.25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "tänään klo 03.00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "huomenna klo 02.00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "tänään klo 01.00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "eilen klo 02.00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [klo] LT'), "today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [klo] LT'), "today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), "today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[viime] dddd[na] [klo] LT'), "today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "yksi viikko sitten");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "yhden viikon päästä");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "kaksi viikkoa sitten");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "kaden viikon päästä");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Aujourd'hui à 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Demain à 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Hier à 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
"same all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Aujourd'hui à 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Aujourd'hui à 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Aujourd'hui à 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Demain à 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Aujourd'hui à 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Hier à 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
},
"same all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "hoxe ás 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "hoxe ás 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "mañá ás 2:00", "tomorrow at the same time");
- test.equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañá á 1:00", "tomorrow minus 1 hour");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe á 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "hoxe ás 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "mañá ás 2:00", "tomorrow at the same time");
+ test.equal(moment(a).add({d: 1, h : -1}).calendar(), "mañá á 1:00", "tomorrow minus 1 hour");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "hoxe á 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "onte á 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
"regression tests" : function (test) {
- var lastWeek = moment().subtract({ d: 4 }).hours(1);
+ var lastWeek = moment().subtract({d: 4}).hours(1);
test.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), "1 o'clock bug");
test.done();
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "היום ב־02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "היום ב־02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "היום ב־03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "מחר ב־02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "היום ב־01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "אתמול ב־02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "היום ב־02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "היום ב־03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "מחר ב־02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "היום ב־01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "אתמול ב־02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [בשעה] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [בשעה] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[ביום] dddd [האחרון בשעה] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "आज रात २:०० बजे", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "आज रात २:२५ बजे", "Now plus 25 min");
- test.equal(moment(a).add({ h: 3 }).calendar(), "आज सुबह ५:०० बजे", "Now plus 3 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "कल रात २:०० बजे", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "आज रात १:०० बजे", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "कल रात २:०० बजे", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "आज रात २:२५ बजे", "Now plus 25 min");
+ test.equal(moment(a).add({h: 3}).calendar(), "आज सुबह ५:०० बजे", "Now plus 3 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "कल रात २:०० बजे", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "आज रात १:०० बजे", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "कल रात २:०० बजे", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[पिछले] dddd[,] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "danas u 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "danas u 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "danas u 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "sutra u 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "danas u 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "jučer u 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "danas u 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "danas u 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "sutra u 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "danas u 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "jučer u 2:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "ma 2:00-kor", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "ma 2:25-kor", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "ma 3:00-kor", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "holnap 2:00-kor", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "ma 1:00-kor", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "tegnap 2:00-kor", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "ma 2:25-kor", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "ma 3:00-kor", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "holnap 2:00-kor", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "ma 1:00-kor", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "tegnap 2:00-kor", "yesterday at the same time");
test.done();
},
var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), "today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[' + days[m.day()] + '] LT[-kor]'), "today + " + i + " days beginning of day");
var i, m, days = 'vasárnap_hétfőn_kedden_szerdán_csütörtökön_pénteken_szombaton'.split('_');
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), "today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[múlt ' + days[m.day()] + '] LT[-kor]'), "today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "egy héte");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "egy hét múlva");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 hete");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "2 hét múlva");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "այսօր 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "այսօր 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "այսօր 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "վաղը 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "այսօր 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "երեկ 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "այսօր 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "այսօր 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "վաղը 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "այսօր 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "երեկ 02:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hari ini pukul 02.00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hari ini pukul 02.25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hari ini pukul 03.00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Besok pukul 02.00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hari ini pukul 01.00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Kemarin pukul 02.00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hari ini pukul 02.25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hari ini pukul 03.00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Besok pukul 02.00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hari ini pukul 01.00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Kemarin pukul 02.00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [pukul] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [pukul] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [lalu pukul] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "í dag kl. 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "í dag kl. 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "í dag kl. 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "á morgun kl. 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "í dag kl. 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "í gær kl. 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "í dag kl. 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "í dag kl. 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "á morgun kl. 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "í dag kl. 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "í gær kl. 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[síðasta] dddd [kl.] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Oggi alle 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Oggi alle 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Domani alle 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ieri alle 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Oggi alle 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Domani alle 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Ieri alle 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "今日 午前2時0分", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "今日 午前2時25分", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "今日 午前3時0分", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "明日 午前2時0分", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "今日 午前1時0分", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨日 午前2時0分", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "今日 午前2時25分", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "今日 午前3時0分", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "明日 午前2時0分", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "今日 午前1時0分", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "昨日 午前2時0分", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[来週]dddd LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[前週]dddd LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "დღეს 2:00 AM-ზე", "დღეს ამავე დროს");
- test.equal(moment(a).add({ m: 25 }).calendar(), "დღეს 2:25 AM-ზე", "ახლანდელ დროს დამატებული 25 წუთი");
- test.equal(moment(a).add({ h: 1 }).calendar(), "დღეს 3:00 AM-ზე", "ახლანდელ დროს დამატებული 1 საათი");
- test.equal(moment(a).add({ d: 1 }).calendar(), "ხვალ 2:00 AM-ზე", "ხვალ ამავე დროს");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "დღეს 1:00 AM-ზე", "ახლანდელ დროს გამოკლებული 1 საათი");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "გუშინ 2:00 AM-ზე", "გუშინ ამავე დროს");
+ test.equal(moment(a).add({m: 25}).calendar(), "დღეს 2:25 AM-ზე", "ახლანდელ დროს დამატებული 25 წუთი");
+ test.equal(moment(a).add({h: 1}).calendar(), "დღეს 3:00 AM-ზე", "ახლანდელ დროს დამატებული 1 საათი");
+ test.equal(moment(a).add({d: 1}).calendar(), "ხვალ 2:00 AM-ზე", "ხვალ ამავე დროს");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "დღეს 1:00 AM-ზე", "ახლანდელ დროს გამოკლებული 1 საათი");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "გუშინ 2:00 AM-ზე", "გუშინ ამავე დროს");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), "დღეს + " + i + " დღე ახლანდელ დროს");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[შემდეგ] dddd LT[-ზე]'), "დღეს + " + i + " დღე დღის დასაწყისში");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), "დღეს - " + i + " დღე ახლანდელ დროს");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[წინა] dddd LT[-ზე]'), "დღეს - " + i + " დღე დღის დასაწყისში");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 კვირის წინ");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "1 კვირაში");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 კვირის წინ");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "2 კვირაში");
"format": function (test) {
var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'],
- ['ddd, hA', 'អាទិត្យ, 3PM'],
- ['M Mo MM MMMM MMM', '2 2 02 កុម្ភៈ កុម្ភៈ'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14 14'],
- ['d do dddd ddd dd', '0 0 អាទិត្យ អាទិត្យ អាទិត្យ'],
- ['DDD DDDo DDDD', '45 45 045'],
- ['w wo ww', '6 6 06'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['[the] DDDo [day of the year]', 'the 45 day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 កុម្ភៈ 2010'],
- ['LLL', '14 កុម្ភៈ 2010 15:25'],
- ['LLLL', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'],
- ['l', '14/2/2010'],
- ['ll', '14 កុម្ភៈ 2010'],
- ['lll', '14 កុម្ភៈ 2010 15:25'],
- ['llll', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25']
- ],
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'អាទិត្យ, កុម្ភៈ 14 2010, 3:25:50 pm'],
+ ['ddd, hA', 'អាទិត្យ, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2 02 កុម្ភៈ កុម្ភៈ'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14 14'],
+ ['d do dddd ddd dd', '0 0 អាទិត្យ អាទិត្យ អាទិត្យ'],
+ ['DDD DDDo DDDD', '45 45 045'],
+ ['w wo ww', '6 6 06'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['[the] DDDo [day of the year]', 'the 45 day of the year'],
+ ['L', '14/02/2010'],
+ ['LL', '14 កុម្ភៈ 2010'],
+ ['LLL', '14 កុម្ភៈ 2010 15:25'],
+ ['LLLL', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25'],
+ ['l', '14/2/2010'],
+ ['ll', '14 កុម្ភៈ 2010'],
+ ['lll', '14 កុម្ភៈ 2010 15:25'],
+ ['llll', 'អាទិត្យ, 14 កុម្ភៈ 2010 15:25']
+ ],
b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
i;
for (i = 0; i < a.length; i++) {
"from": function (test) {
var start = moment([2007, 1, 28]);
- test.equal(start.from(moment([2007, 1, 28]).add({ s: 44 }), true), "ប៉ុន្មានវិនាទី", "44 seconds = ប៉ុន្មានវិនាទី");
- test.equal(start.from(moment([2007, 1, 28]).add({ s: 45 }), true), "មួយនាទី", "45 seconds = មួយនាទី");
- test.equal(start.from(moment([2007, 1, 28]).add({ s: 89 }), true), "មួយនាទី", "89 seconds = មួយនាទី");
- test.equal(start.from(moment([2007, 1, 28]).add({ s: 90 }), true), "2 នាទី", "90 seconds = 2 នាទី");
- test.equal(start.from(moment([2007, 1, 28]).add({ m: 44 }), true), "44 នាទី", "44 minutes = 44 នាទី");
- test.equal(start.from(moment([2007, 1, 28]).add({ m: 45 }), true), "មួយម៉ោង", "45 minutes = មួយម៉ោង");
- test.equal(start.from(moment([2007, 1, 28]).add({ m: 89 }), true), "មួយម៉ោង", "89 minutes = មួយម៉ោង");
- test.equal(start.from(moment([2007, 1, 28]).add({ m: 90 }), true), "2 ម៉ោង", "90 minutes = 2 ម៉ោង");
- test.equal(start.from(moment([2007, 1, 28]).add({ h: 5 }), true), "5 ម៉ោង", "5 hours = 5 ម៉ោង");
- test.equal(start.from(moment([2007, 1, 28]).add({ h: 21 }), true), "21 ម៉ោង", "21 hours = 21 ម៉ោង");
- test.equal(start.from(moment([2007, 1, 28]).add({ h: 22 }), true), "មួយថ្ងៃ", "22 hours = មួយថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ h: 35 }), true), "មួយថ្ងៃ", "35 hours = មួយថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ h: 36 }), true), "2 ថ្ងៃ", "36 hours = 2 ថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 1 }), true), "មួយថ្ងៃ", "1 day = មួយថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 5 }), true), "5 ថ្ងៃ", "5 days = 5 ថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 25 }), true), "25 ថ្ងៃ", "25 days = 25 ថ្ងៃ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 26 }), true), "មួយខែ", "26 days = មួយខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 30 }), true), "មួយខែ", "30 days = មួយខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 43 }), true), "មួយខែ", "43 days = មួយខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 46 }), true), "2 ខែ", "46 days = 2 ខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 74 }), true), "2 ខែ", "75 days = 2 ខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 76 }), true), "3 ខែ", "76 days = 3 ខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ M: 1 }), true), "មួយខែ", "1 month = មួយខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ M: 5 }), true), "5 ខែ", "5 months = 5 ខែ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 345 }), true), "មួយឆ្នាំ", "345 days = មួយឆ្នាំ");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 548 }), true), "2 ឆ្នាំ", "548 days = 2 ឆ្នាំ");
- test.equal(start.from(moment([2007, 1, 28]).add({ y: 1 }), true), "មួយឆ្នាំ", "1 year = មួយឆ្នាំ");
- test.equal(start.from(moment([2007, 1, 28]).add({ y: 5 }), true), "5 ឆ្នាំ", "5 years = 5 ឆ្នាំ");
+ test.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), "ប៉ុន្មានវិនាទី", "44 seconds = ប៉ុន្មានវិនាទី");
+ test.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), "មួយនាទី", "45 seconds = មួយនាទី");
+ test.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), "មួយនាទី", "89 seconds = មួយនាទី");
+ test.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), "2 នាទី", "90 seconds = 2 នាទី");
+ test.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), "44 នាទី", "44 minutes = 44 នាទី");
+ test.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), "មួយម៉ោង", "45 minutes = មួយម៉ោង");
+ test.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), "មួយម៉ោង", "89 minutes = មួយម៉ោង");
+ test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), "2 ម៉ោង", "90 minutes = 2 ម៉ោង");
+ test.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), "5 ម៉ោង", "5 hours = 5 ម៉ោង");
+ test.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), "21 ម៉ោង", "21 hours = 21 ម៉ោង");
+ test.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), "មួយថ្ងៃ", "22 hours = មួយថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), "មួយថ្ងៃ", "35 hours = មួយថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), "2 ថ្ងៃ", "36 hours = 2 ថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), "មួយថ្ងៃ", "1 day = មួយថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), "5 ថ្ងៃ", "5 days = 5 ថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), "25 ថ្ងៃ", "25 days = 25 ថ្ងៃ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), "មួយខែ", "26 days = មួយខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), "មួយខែ", "30 days = មួយខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), "មួយខែ", "43 days = មួយខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), "2 ខែ", "46 days = 2 ខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), "2 ខែ", "75 days = 2 ខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), "3 ខែ", "76 days = 3 ខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), "មួយខែ", "1 month = មួយខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), "5 ខែ", "5 months = 5 ខែ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), "មួយឆ្នាំ", "345 days = មួយឆ្នាំ");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "2 ឆ្នាំ", "548 days = 2 ឆ្នាំ");
+ test.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), "មួយឆ្នាំ", "1 year = មួយឆ្នាំ");
+ test.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), "5 ឆ្នាំ", "5 years = 5 ឆ្នាំ");
test.done();
},
"calendar all else": function (test) {
var weeksAgo = moment().subtract({
- w: 1
- }),
+ w: 1
+ }),
weeksFromNow = moment().add({
w: 1
});
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var i, m, weekday, datestring;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
// Different date string for "Dënschdeg" (Tuesday) and "Donneschdeg" (Thursday)
weekday = parseInt(m.format('d'), 10);
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Šiandien 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Šiandien 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Šiandien 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Rytoj 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Šiandien 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Vakar 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Šiandien 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Šiandien 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Rytoj 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Šiandien 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Vakar 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Praėjusį] dddd LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Šodien pulksten 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Šodien pulksten 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Šodien pulksten 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Rīt pulksten 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Šodien pulksten 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Vakar pulksten 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Šodien pulksten 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Šodien pulksten 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Rīt pulksten 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Šodien pulksten 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Vakar pulksten 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [pulksten] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [pulksten] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Pagājušā] dddd [pulksten] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Денес во 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Денес во 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Денес во 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Утре во 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Денес во 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера во 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Денес во 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Денес во 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Утре во 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Денес во 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Вчера во 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [во] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [во] LT'), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "ഇന്ന് രാത്രി 2:00 -നു", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "ഇന്ന് രാത്രി 2:25 -നു", "Now plus 25 min");
- test.equal(moment(a).add({ h: 3 }).calendar(), "ഇന്ന് രാവിലെ 5:00 -നു", "Now plus 3 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "നാളെ രാത്രി 2:00 -നു", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "ഇന്ന് രാത്രി 1:00 -നു", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "ഇന്നലെ രാത്രി 2:00 -നു", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "ഇന്ന് രാത്രി 2:25 -നു", "Now plus 25 min");
+ test.equal(moment(a).add({h: 3}).calendar(), "ഇന്ന് രാവിലെ 5:00 -നു", "Now plus 3 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "നാളെ രാത്രി 2:00 -നു", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "ഇന്ന് രാത്രി 1:00 -നു", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "ഇന്നലെ രാത്രി 2:00 -നു", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[കഴിഞ്ഞ] dddd[,] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), "एक मिनिट", "45 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), "एक मिनिट", "89 seconds = a minute");
test.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), "२ मिनिटे", "90 seconds = 2 minutes");
- test.equal(start.from(moment([2007, 1, 28]).add({ m: 44 }), true), "४४ मिनिटे", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), "४४ मिनिटे", "44 minutes = 44 minutes");
test.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), "एक तास", "45 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), "एक तास", "89 minutes = an hour");
test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), "२ तास", "90 minutes = 2 hours");
test.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), "एक दिवस", "1 day = a day");
test.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), "५ दिवस", "5 days = 5 days");
test.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), "२५ दिवस", "25 days = 25 days");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 26 }), true), "एक महिना", "26 days = a month");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 30 }), true), "एक महिना", "30 days = a month");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 43 }), true), "एक महिना", "43 days = a month");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 46 }), true), "२ महिने", "46 days = 2 months");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 74 }), true), "२ महिने", "75 days = 2 months");
- test.equal(start.from(moment([2007, 1, 28]).add({ d: 76 }), true), "३ महिने", "76 days = 3 months");
- test.equal(start.from(moment([2007, 1, 28]).add({ M: 1 }), true), "एक महिना", "1 month = a month");
- test.equal(start.from(moment([2007, 1, 28]).add({ M: 5 }), true), "५ महिने", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), "एक महिना", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), "एक महिना", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), "एक महिना", "43 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), "२ महिने", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), "२ महिने", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), "३ महिने", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), "एक महिना", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), "५ महिने", "5 months = 5 months");
test.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), "एक वर्ष", "345 days = a year");
test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "२ वर्षे", "548 days = 2 years");
test.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), "एक वर्ष", "1 year = a year");
- test.equal(start.from(moment([2007, 1, 28]).add({ y: 5 }), true), "५ वर्षे", "5 years = 5 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), "५ वर्षे", "5 years = 5 years");
test.done();
},
},
"fromNow" : function (test) {
- test.equal(moment().add({ s: 30 }).fromNow(), "सेकंद नंतर", "सेकंद नंतर");
- test.equal(moment().add({ d: 5 }).fromNow(), "५ दिवस नंतर", "५ दिवस नंतर");
+ test.equal(moment().add({s: 30}).fromNow(), "सेकंद नंतर", "सेकंद नंतर");
+ test.equal(moment().add({d: 5}).fromNow(), "५ दिवस नंतर", "५ दिवस नंतर");
test.done();
},
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "आज रात्री २:०० वाजता", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "आज रात्री २:२५ वाजता", "Now plus 25 min");
- test.equal(moment(a).add({ h: 3 }).calendar(), "आज सकाळी ५:०० वाजता", "Now plus 3 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "उद्या रात्री २:०० वाजता", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "आज रात्री १:०० वाजता", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "काल रात्री २:०० वाजता", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "आज रात्री २:२५ वाजता", "Now plus 25 min");
+ test.equal(moment(a).add({h: 3}).calendar(), "आज सकाळी ५:०० वाजता", "Now plus 3 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "उद्या रात्री २:०० वाजता", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "आज रात्री १:०० वाजता", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "काल रात्री २:०० वाजता", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd[,] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[मागील] dddd[,] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hari ini pukul 02.00", "hari ini pada waktu yang sama");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hari ini pukul 02.25", "Sekarang tambah 25 minit");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hari ini pukul 03.00", "Sekarang tambah 1 jam");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Esok pukul 02.00", "esok pada waktu yang sama");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hari ini pukul 01.00", "Sekarang tolak 1 jam");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Kelmarin pukul 02.00", "kelmarin pada waktu yang sama");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hari ini pukul 02.25", "Sekarang tambah 25 minit");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hari ini pukul 03.00", "Sekarang tambah 1 jam");
+ test.equal(moment(a).add({d: 1}).calendar(), "Esok pukul 02.00", "esok pada waktu yang sama");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hari ini pukul 01.00", "Sekarang tolak 1 jam");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Kelmarin pukul 02.00", "kelmarin pada waktu yang sama");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [pukul] LT'), "Hari ini + " + i + " hari waktu sekarang");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [pukul] LT'), "Hari ini + " + i + " hari permulaan hari");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), "Hari ini - " + i + " hari waktu sekarang");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [lepas] [pukul] LT'), "Hari ini - " + i + " hari permulaan hari");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 minggu lepas");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "dalam 1 minggu");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 minggu lepas");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "dalam 2 minggu");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "i dag kl. 2.00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "i dag kl. 2.25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "i dag kl. 3.00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "i morgen kl. 2.00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "i dag kl. 1.00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "i går kl. 2.00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "i dag kl. 2.25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "i dag kl. 3.00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "i morgen kl. 2.00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "i dag kl. 1.00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "i går kl. 2.00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [kl.] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[forrige] dddd [kl.] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "आज रातीको २:०० बजे", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "आज रातीको २:२५ बजे", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "आज बिहानको ३:०० बजे", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "भोली रातीको २:०० बजे", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "आज रातीको १:०० बजे", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "हिजो रातीको २:०० बजे", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "आज रातीको २:२५ बजे", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "आज बिहानको ३:०० बजे", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "भोली रातीको २:०० बजे", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "आज रातीको १:०० बजे", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "हिजो रातीको २:०० बजे", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[आउँदो] dddd[,] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[गएको] dddd[,] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "vandaag om 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "vandaag om 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "vandaag om 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "morgen om 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "vandaag om 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "gisteren om 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "vandaag om 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "vandaag om 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "morgen om 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "vandaag om 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "gisteren om 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "I dag klokka 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "I dag klokka 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "I dag klokka 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "I morgon klokka 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokka 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokka 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "I dag klokka 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "I dag klokka 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "I morgon klokka 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "I dag klokka 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "I går klokka 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [klokka] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [klokka] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Føregåande] dddd [klokka] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Dziś o 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Dziś o 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Dziś o 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Jutro o 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Dziś o 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Dziś o 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Dziś o 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Jutro o 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Dziś o 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hoje às 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hoje às 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hoje às 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Ontem às 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hoje às 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hoje às 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hoje às 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Ontem às 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "azi la 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "azi la 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "azi la 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "mâine la 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "azi la 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "ieri la 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "azi la 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "azi la 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "mâine la 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "azi la 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "ieri la 2:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [la] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [la] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[fosta] dddd [la] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Сегодня в 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Сегодня в 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Сегодня в 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Завтра в 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Сегодня в 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Сегодня в 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Сегодня в 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Завтра в 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Сегодня в 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Вчера в 02:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "dnes o 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "dnes o 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "dnes o 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "zajtra o 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "dnes o 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "včera o 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "dnes o 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "dnes o 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "zajtra o 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "dnes o 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "včera o 2:00", "yesterday at the same time");
test.done();
},
var i, m, nextDay;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
nextDay = '';
switch (m.day()) {
case 0:
var i, m, lastDay;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
lastDay = '';
switch (m.day()) {
case 0:
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "danes ob 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "danes ob 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "danes ob 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "jutri ob 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "danes ob 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "včeraj ob 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "danes ob 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "danes ob 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "jutri ob 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "danes ob 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "včeraj ob 2:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Sot në 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Sot në 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Sot në 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Nesër në 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Sot në 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Dje në 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Sot në 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Sot në 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Nesër në 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Sot në 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Dje në 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [në] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [në] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [e kaluar në] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [e kaluar në] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "данас у 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "данас у 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "данас у 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "сутра у 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "данас у 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "јуче у 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "данас у 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "данас у 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "сутра у 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "данас у 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "јуче у 2:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "danas u 2:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "danas u 2:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "danas u 3:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "sutra u 2:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "danas u 1:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "juče u 2:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "danas u 2:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "danas u 3:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "sutra u 2:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "danas u 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "juče u 2:00", "yesterday at the same time");
test.done();
},
}
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Idag 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Idag 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Idag 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Imorgon 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Idag 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Igår 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Idag 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Idag 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Imorgon 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Idag 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Igår 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Förra] dddd[en] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Förra] dddd[en] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "இன்று 02:00", "இன்று 02:00");
- test.equal(moment(a).add({ m: 25 }).calendar(), "இன்று 02:25", "இன்று 02:25");
- test.equal(moment(a).add({ h: 1 }).calendar(), "இன்று 03:00", "இன்று 03:00");
- test.equal(moment(a).add({ d: 1 }).calendar(), "நாளை 02:00", "நாளை 02:00");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "இன்று 01:00", "இன்று 01:00");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "நேற்று 02:00", "நேற்று 02:00");
+ test.equal(moment(a).add({m: 25}).calendar(), "இன்று 02:25", "இன்று 02:25");
+ test.equal(moment(a).add({h: 1}).calendar(), "இன்று 03:00", "இன்று 03:00");
+ test.equal(moment(a).add({d: 1}).calendar(), "நாளை 02:00", "நாளை 02:00");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "இன்று 01:00", "இன்று 01:00");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "நேற்று 02:00", "நேற்று 02:00");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd, LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd, LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[கடந்த வாரம்] dddd, LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[கடந்த வாரம்] dddd, LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "วันนี้ เวลา 2 นาฬิกา 0 นาที", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "วันนี้ เวลา 2 นาฬิกา 25 นาที", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "วันนี้ เวลา 3 นาฬิกา 0 นาที", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "พรุ่งนี้ เวลา 2 นาฬิกา 0 นาที", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "วันนี้ เวลา 1 นาฬิกา 0 นาที", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "เมื่อวานนี้ เวลา 2 นาฬิกา 0 นาที", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "วันนี้ เวลา 2 นาฬิกา 25 นาที", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "วันนี้ เวลา 3 นาฬิกา 0 นาที", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "พรุ่งนี้ เวลา 2 นาฬิกา 0 นาที", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "วันนี้ เวลา 1 นาฬิกา 0 นาที", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "เมื่อวานนี้ เวลา 2 นาฬิกา 0 นาที", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd[หน้า เวลา] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd[หน้า เวลา] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[วัน]dddd[ที่แล้ว เวลา] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[วัน]dddd[ที่แล้ว เวลา] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Ngayon sa 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Ngayon sa 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Ngayon sa 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Bukas sa 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Ngayon sa 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Kahapon sa 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Ngayon sa 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Ngayon sa 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Bukas sa 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Ngayon sa 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Kahapon sa 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [sa] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [sa] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [huling linggo] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [huling linggo] LT'), "Today - " + i + " days beginning of day");
},
"same all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "bugün saat 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "bugün saat 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "bugün saat 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "yarın saat 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "bugün saat 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "dün 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "bugün saat 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "bugün saat 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "yarın saat 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "bugün saat 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "dün 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "asdkh g 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "asdkh g 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "asdkh g 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "aska g 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "asdkh g 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "assant g 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "asdkh g 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "asdkh g 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "aska g 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "asdkh g 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "assant g 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [g] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [g] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [g] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [g] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "ⴰⵙⴷⵅ ⴴ 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "ⴰⵙⴷⵅ ⴴ 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "ⴰⵙⴷⵅ ⴴ 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "ⴰⵙⴽⴰ ⴴ 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "ⴰⵙⴷⵅ ⴴ 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "ⴰⵚⴰⵏⵜ ⴴ 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "ⴰⵙⴷⵅ ⴴ 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "ⴰⵙⴷⵅ ⴴ 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "ⴰⵙⴽⴰ ⴴ 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "ⴰⵙⴷⵅ ⴴ 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "ⴰⵚⴰⵏⵜ ⴴ 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [ⴴ] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [ⴴ] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [ⴴ] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [ⴴ] LT'), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Сьогодні о 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Сьогодні о 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Сьогодні о 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Завтра о 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Сьогодні о 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Вчора о 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Сьогодні о 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Сьогодні о 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Завтра о 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Сьогодні о 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Вчора о 02:00", "yesterday at the same time");
// A special case for Ukrainian since 11 hours have different preposition
- test.equal(moment(a).add({ h: 9 }).calendar(), "Сьогодні об 11:00", "same day at 11 o'clock");
+ test.equal(moment(a).add({h: 9}).calendar(), "Сьогодні об 11:00", "same day at 11 o'clock");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[У] dddd [о' + (m.hours() === 11 ? 'б' : '') + '] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[У] dddd [о] LT'), "Today + " + i + " days beginning of day");
}
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
},
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Бугун соат 02:00 да", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Бугун соат 02:25 да", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Бугун соат 03:00 да", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Эртага 02:00 да", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Бугун соат 01:00 да", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Кеча соат 02:00 да", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Бугун соат 02:25 да", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Бугун соат 03:00 да", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Эртага 02:00 да", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Бугун соат 01:00 да", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Кеча соат 02:00 да", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [куни соат] LT [да]'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [куни соат] LT [да]'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[Утган] dddd [куни соат] LT [да]'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[Утган] dddd [куни соат] LT [да]'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Hôm nay lúc 02:00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Hôm nay lúc 02:25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Hôm nay lúc 03:00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Ngày mai lúc 02:00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Hôm nay lúc 01:00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Hôm qua lúc 02:00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Hôm nay lúc 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Hôm nay lúc 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Ngày mai lúc 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Hôm nay lúc 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Hôm qua lúc 02:00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('dddd [tuần tới lúc] LT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [tuần tới lúc] LT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('dddd [tuần rồi lúc] LT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('dddd [tuần rồi lúc] LT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "今天凌晨2点整", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "今天凌晨2点25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "今天凌晨3点整", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "明天凌晨2点整", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天凌晨1点整", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天凌晨2点整", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "今天凌晨2点25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "今天凌晨3点整", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "明天凌晨2点整", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "今天凌晨1点整", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "昨天凌晨2点整", "yesterday at the same time");
test.done();
},
today = moment().startOf('day');
for (i = 0; i < 7; i++) {
- m = moment().startOf('week').add({ d: i});
+ m = moment().startOf('week').add({d: i});
if (Math.abs(m.diff(today, 'days')) <= 1) {
continue; // skip today, yesterday, tomorrow
}
today = moment().startOf('day');
for (i = 7; i < 14; i++) {
- m = moment().startOf('week').add({ d: i});
+ m = moment().startOf('week').add({d: i});
if (Math.abs(m.diff(today, 'days')) >= 7) {
continue;
}
today = moment().startOf('day');
for (i = 1; i < 8; i++) {
- m = moment().startOf('week').subtract({ d: i});
+ m = moment().startOf('week').subtract({d: i});
if ((Math.abs(m.diff(today, 'days')) >= 7) || (Math.abs(m.diff(today, 'days')) <= 1)) {
continue;
}
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('LL'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('LL'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('LL'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('LL'), "in 2 weeks");
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "今天早上2點00", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "今天早上2點25", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "今天早上3點00", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "明天早上2點00", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天早上1點00", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天早上2點00", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "今天早上2點25", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "今天早上3點00", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "明天早上2點00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "今天早上1點00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "昨天早上2點00", "yesterday at the same time");
test.done();
},
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
+ m = moment().add({d: i});
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days beginning of day");
var i, m;
for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
+ m = moment().subtract({d: i});
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days beginning of day");
"calendar all else" : function (test) {
- var weeksAgo = moment().subtract({ w: 1 }),
- weeksFromNow = moment().add({ w: 1 });
+ var weeksAgo = moment().subtract({w: 1}),
+ weeksFromNow = moment().add({w: 1});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
+ weeksAgo = moment().subtract({w: 2});
+ weeksFromNow = moment().add({w: 2});
test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-var moment = require("../../moment");
+var moment = require("../../moment"),
-var getVerifier = function (test) {
- return function (input, format, expected, description, asymetrical) {
- var m = moment(input, format);
- test.equal(m.format('YYYY MM DD'), expected, 'compare: ' + description);
+ getVerifier = function (test) {
+ return function (input, format, expected, description, asymetrical) {
+ var m = moment(input, format);
+ test.equal(m.format('YYYY MM DD'), expected, 'compare: ' + description);
- //test round trip
- if (!asymetrical) {
- test.equal(m.format(format), input, 'round trip: ' + description);
- }
+ //test round trip
+ if (!asymetrical) {
+ test.equal(m.format(format), input, 'round trip: ' + description);
+ }
+ };
};
-};
exports.create = {
setUp : function (done) {
test.equal(moment('1994', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).year(), 1994, 'iso: test parse YYYY');
test.equal(moment('17:15', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).hour(), 17, 'iso: test parse HH:mm (1)');
test.equal(moment('17:15', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).minutes(), 15, 'iso: test parse HH:mm (2)');
- test.equal(moment('06', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).month(), 6-1, 'iso: test parse MM');
+ test.equal(moment('06', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).month(), 6 - 1, 'iso: test parse MM');
test.equal(moment('2012-06-01', [moment.ISO_8601, 'MM', 'HH:mm', 'YYYY']).parsingFlags().iso, true, 'iso: test parse iso');
test.equal(moment('2014-05-05', [moment.ISO_8601, 'YYYY-MM-DD']).parsingFlags().iso, true, 'iso: edge case array precedence iso');
test.equal(moment('2014-05-05', ['YYYY-MM-DD', moment.ISO_8601]).parsingFlags().iso, false, 'iso: edge case array precedence not iso');
"parsing iso Z timezone" : function (test) {
var i,
formats = [
- ['2011-10-08T18:04Z', '2011-10-08T18:04:00.000+00:00'],
- ['2011-10-08T18:04:20Z', '2011-10-08T18:04:20.000+00:00'],
- ['2011-10-08T18:04:20.111Z', '2011-10-08T18:04:20.111+00:00']
- ];
+ ['2011-10-08T18:04Z', '2011-10-08T18:04:00.000+00:00'],
+ ['2011-10-08T18:04:20Z', '2011-10-08T18:04:20.000+00:00'],
+ ['2011-10-08T18:04:20.111Z', '2011-10-08T18:04:20.111+00:00']
+ ];
test.expect(formats.length);
for (i = 0; i < formats.length; i++) {
test.equal(moment.utc(formats[i][0]).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), formats[i][1], "moment should be able to parse ISO " + formats[i][0]);
"six digit years" : function (test) {
test.expect(8);
test.equal(moment([-270000, 0, 1]).format("YYYYY-MM-DD"), "-270000-01-01", "format BC 270,001");
- test.equal(moment([ 270000, 0, 1]).format("YYYYY-MM-DD"), "270000-01-01", "format AD 270,000");
+ test.equal(moment([270000, 0, 1]).format("YYYYY-MM-DD"), "270000-01-01", "format AD 270,000");
test.equal(moment("-270000-01-01", "YYYYY-MM-DD").toDate().getFullYear(), -270000, "parse BC 270,001");
test.equal(moment("270000-01-01", "YYYYY-MM-DD").toDate().getFullYear(), 270000, "parse AD 270,000");
test.equal(moment("+270000-01-01", "YYYYY-MM-DD").toDate().getFullYear(), 270000, "parse AD +270,000");
"toJSON skips postformat" : function (test) {
test.expect(1);
- moment.lang('postformat', {postformat: function (s) { s.replace(/./g, 'X'); }});
+ moment.lang('postformat', {
+ postformat: function (s) {
+ s.replace(/./g, 'X');
+ }
+ });
test.equal(moment.utc([2000, 0, 1]).toJSON(), "2000-01-01T00:00:00.000Z", "toJSON doesn't postformat");
moment.lang('postformat', null);
test.done();
moment.lang('en');
var zones = [60, -60, 90, -90, 360, -360, 720, -720],
- b = moment().utc().startOf('day').subtract({ m : 1 }),
- c = moment().local().startOf('day').subtract({ m : 1 }),
- d = moment().local().startOf('day').subtract({ d : 2 }),
+ b = moment().utc().startOf('day').subtract({m : 1}),
+ c = moment().local().startOf('day').subtract({m : 1}),
+ d = moment().local().startOf('day').subtract({d : 2}),
i, z, a;
for (i = 0; i < zones.length; ++i) {
z = zones[i];
- a = moment().zone(z).startOf('day').subtract({ m: 1 });
+ a = moment().zone(z).startOf('day').subtract({m: 1});
test.equal(moment(a).zone(z).calendar(), "Yesterday at 11:59 PM", "Yesterday at 11:59 PM, not Today, or the wrong time");
}
// test.equals(a.weekday(), 1);
// test.done();
- // },
+ //},
// I think this suffers from the same issue as the non-iso version.
// "setters programatic with weeks ISO" : function (test) {
// test.equals(a.day(), 4);
// test.done();
- // },
+ //},
"setters strings" : function (test) {
test.expect(7);
},
"manipulation methods" : function (test) {
-
- var mutableMethods = {
- 'year': function (m) { return m.year(2011); },
- 'month': function (m) { return m.month(1); },
- 'date': function (m) { return m.date(9); },
- 'hours': function (m) { return m.hours(7); },
- 'minutes': function (m) { return m.minutes(33); },
- 'seconds': function (m) { return m.seconds(44); },
- 'milliseconds': function (m) { return m.milliseconds(55); },
- 'day': function (m) { return m.day(2); },
- 'startOf': function (m) { return m.startOf('week'); },
- 'endOf': function (m) { return m.endOf('week'); },
- 'add': function (m) { return m.add('days', 1); },
- 'subtract': function (m) { return m.subtract('years', 2); },
- 'local': function (m) { return m.local(); },
- 'utc': function (m) { return m.utc(); }
- }, method, d, d2;
-
- test.expect(14);
-
- for (method in mutableMethods) {
- if (mutableMethods.hasOwnProperty(method)) {
- d = moment();
- d2 = mutableMethods[method](d);
- test.equal(d, d2, method + "() should be mutable");
- }
- }
+ var m = moment();
+
+ test.equal(m, m.year(2011), 'year() should be mutable');
+ test.equal(m, m.month(1), 'month() should be mutable');
+ test.equal(m, m.hours(7), 'hours() should be mutable');
+ test.equal(m, m.minutes(33), 'minutes() should be mutable');
+ test.equal(m, m.seconds(44), 'seconds() should be mutable');
+ test.equal(m, m.milliseconds(55), 'milliseconds() should be mutable');
+ test.equal(m, m.day(2), 'day() should be mutable');
+ test.equal(m, m.startOf('week'), 'startOf() should be mutable');
+ test.equal(m, m.add(1, 'days'), 'add() should be mutable');
+ test.equal(m, m.subtract(2, 'years'), 'subtract() should be mutable');
+ test.equal(m, m.local(), 'local() should be mutable');
+ test.equal(m, m.utc(), 'utc() should be mutable');
test.done();
},
"non mutable methods" : function (test) {
-
- var nonMutableMethods = {
- 'clone': function (m) { return m.clone(); }
- }, method, d, d2;
-
- test.expect(1);
-
- for (method in nonMutableMethods) {
- if (nonMutableMethods.hasOwnProperty(method)) {
- d = new Date();
- d2 = nonMutableMethods[method](moment(d)).toDate();
- test.notEqual(d, d2, method + "() should not be mutable");
- }
- }
+ var m = moment();
+ test.notEqual(m, m.clone(), "clone() should not be mutable");
test.done();
}
-
};
-var moment = require("../../moment");
-
-
-var symbolMap = {
- '1': '!',
- '2': '@',
- '3': '#',
- '4': '$',
- '5': '%',
- '6': '^',
- '7': '&',
- '8': '*',
- '9': '(',
- '0': ')'
-};
-
-var numberMap = {
- '!': '1',
- '@': '2',
- '#': '3',
- '$': '4',
- '%': '5',
- '^': '6',
- '&': '7',
- '*': '8',
- '(': '9',
- ')': '0'
-};
+var moment = require("../../moment"),
+
+ symbolMap = {
+ '1': '!',
+ '2': '@',
+ '3': '#',
+ '4': '$',
+ '5': '%',
+ '6': '^',
+ '7': '&',
+ '8': '*',
+ '9': '(',
+ '0': ')'
+ },
-var symbolLang = {
- preparse: function (string) {
- return string.replace(/[!@#$%\^&*()]/g, function (match) {
- return numberMap[match];
- });
+ numberMap = {
+ '!': '1',
+ '@': '2',
+ '#': '3',
+ '$': '4',
+ '%': '5',
+ '^': '6',
+ '&': '7',
+ '*': '8',
+ '(': '9',
+ ')': '0'
},
- postformat: function (string) {
- return string.replace(/\d/g, function (match) {
- return symbolMap[match];
- });
- }
-};
+ symbolLang = {
+ preparse: function (string) {
+ return string.replace(/[!@#$%\^&*()]/g, function (match) {
+ return numberMap[match];
+ });
+ },
+
+ postformat: function (string) {
+ return string.replace(/\d/g, function (match) {
+ return symbolMap[match];
+ });
+ }
+ };
exports.preparsePostformat = {
setUp: function (cb) {
var a = moment().hours(2).minutes(0).seconds(0);
test.equal(moment(a).calendar(), "Today at @:)) AM", "today at the same time");
- test.equal(moment(a).add({ m: 25 }).calendar(), "Today at @:@% AM", "Now plus 25 min");
- test.equal(moment(a).add({ h: 1 }).calendar(), "Today at #:)) AM", "Now plus 1 hour");
- test.equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at @:)) AM", "tomorrow at the same time");
- test.equal(moment(a).subtract({ h: 1 }).calendar(), "Today at !:)) AM", "Now minus 1 hour");
- test.equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at @:)) AM", "yesterday at the same time");
+ test.equal(moment(a).add({m: 25}).calendar(), "Today at @:@% AM", "Now plus 25 min");
+ test.equal(moment(a).add({h: 1}).calendar(), "Today at #:)) AM", "Now plus 1 hour");
+ test.equal(moment(a).add({d: 1}).calendar(), "Tomorrow at @:)) AM", "tomorrow at the same time");
+ test.equal(moment(a).subtract({h: 1}).calendar(), "Today at !:)) AM", "Now minus 1 hour");
+ test.equal(moment(a).subtract({d: 1}).calendar(), "Yesterday at @:)) AM", "yesterday at the same time");
test.done();
}
moment.lang('en');
var prior = String.prototype.call, b;
- String.prototype.call = function () { return null; };
+ String.prototype.call = function () {
+ return null;
+ };
b = moment(new Date(2011, 7, 28, 15, 25, 50, 125));
test.equal(b.format('MMMM Do YYYY, h:mm a'), 'August 28th 2011, 3:25 pm');