From 9fd1c261a6275e20cb8622fbe5074f80efab14e7 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Thu, 19 Jun 2014 01:26:20 -0700 Subject: [PATCH] All test files pass jscs --- test/lang/ar-ma.js | 20 +++--- test/lang/ar-sa.js | 22 +++--- test/lang/ar.js | 22 +++--- test/lang/az.js | 22 +++--- test/lang/bg.js | 22 +++--- test/lang/bn.js | 24 +++---- test/lang/br.js | 22 +++--- test/lang/bs.js | 22 +++--- test/lang/ca.js | 24 +++---- test/lang/cs.js | 22 +++--- test/lang/cv.js | 22 +++--- test/lang/cy.js | 22 +++--- test/lang/de-at.js | 22 +++--- test/lang/de.js | 22 +++--- test/lang/el.js | 26 +++---- test/lang/en-au.js | 22 +++--- test/lang/en-ca.js | 22 +++--- test/lang/en-gb.js | 22 +++--- test/lang/en.js | 23 +++---- test/lang/eo.js | 22 +++--- test/lang/es.js | 24 +++---- test/lang/et.js | 22 +++--- test/lang/eu.js | 22 +++--- test/lang/fa.js | 22 +++--- test/lang/fi.js | 22 +++--- test/lang/fr-ca.js | 22 +++--- test/lang/fr.js | 22 +++--- test/lang/gl.js | 26 +++---- test/lang/he.js | 22 +++--- test/lang/hi.js | 22 +++--- test/lang/hr.js | 22 +++--- test/lang/hu.js | 22 +++--- test/lang/hy-am.js | 22 +++--- test/lang/id.js | 22 +++--- test/lang/is.js | 22 +++--- test/lang/it.js | 22 +++--- test/lang/ja.js | 22 +++--- test/lang/ka.js | 22 +++--- test/lang/km.js | 106 ++++++++++++++--------------- test/lang/ko.js | 22 +++--- test/lang/lb.js | 2 +- test/lang/lt.js | 22 +++--- test/lang/lv.js | 22 +++--- test/lang/mk.js | 22 +++--- test/lang/ml.js | 22 +++--- test/lang/mr.js | 46 ++++++------- test/lang/ms-my.js | 22 +++--- test/lang/nb.js | 22 +++--- test/lang/ne.js | 22 +++--- test/lang/nl.js | 22 +++--- test/lang/nn.js | 22 +++--- test/lang/pl.js | 22 +++--- test/lang/pt-br.js | 22 +++--- test/lang/pt.js | 22 +++--- test/lang/ro.js | 22 +++--- test/lang/ru.js | 22 +++--- test/lang/sk.js | 22 +++--- test/lang/sl.js | 22 +++--- test/lang/sq.js | 22 +++--- test/lang/sr-cyrl.js | 22 +++--- test/lang/sr.js | 22 +++--- test/lang/sv.js | 22 +++--- test/lang/ta.js | 22 +++--- test/lang/th.js | 22 +++--- test/lang/tl-ph.js | 22 +++--- test/lang/tr.js | 22 +++--- test/lang/tzm-latn.js | 22 +++--- test/lang/tzm.js | 22 +++--- test/lang/uk.js | 24 +++---- test/lang/uz.js | 22 +++--- test/lang/vi.js | 22 +++--- test/lang/zh-cn.js | 24 +++---- test/lang/zh-tw.js | 22 +++--- test/moment/create.js | 32 ++++----- test/moment/format.js | 14 ++-- test/moment/getters_setters.js | 4 +- test/moment/mutable.js | 58 +++++----------- test/moment/preparse_postformat.js | 87 ++++++++++++----------- test/moment/string_prototype.js | 4 +- 79 files changed, 944 insertions(+), 966 deletions(-) diff --git a/test/lang/ar-ma.js b/test/lang/ar-ma.js index 25d023803..9b0cda617 100644 --- a/test/lang/ar-ma.js +++ b/test/lang/ar-ma.js @@ -177,11 +177,11 @@ exports["lang:ar-ma"] = { 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(); }, @@ -189,7 +189,7 @@ exports["lang:ar-ma"] = { 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"); @@ -214,14 +214,14 @@ exports["lang:ar-ma"] = { }, "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"); diff --git a/test/lang/ar-sa.js b/test/lang/ar-sa.js index 21a8e3652..009154d5e 100644 --- a/test/lang/ar-sa.js +++ b/test/lang/ar-sa.js @@ -191,11 +191,11 @@ exports["lang:ar-sa"] = { 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(); }, @@ -204,7 +204,7 @@ exports["lang:ar-sa"] = { 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"); @@ -219,7 +219,7 @@ exports["lang:ar-sa"] = { 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"); @@ -232,14 +232,14 @@ exports["lang:ar-sa"] = { "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"); diff --git a/test/lang/ar.js b/test/lang/ar.js index 77fa3bb96..c85fabd6a 100644 --- a/test/lang/ar.js +++ b/test/lang/ar.js @@ -180,11 +180,11 @@ exports["lang:ar"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:ar"] = { 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"); @@ -206,7 +206,7 @@ exports["lang:ar"] = { 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"); @@ -218,14 +218,14 @@ exports["lang:ar"] = { "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"); diff --git a/test/lang/az.js b/test/lang/az.js index 0a3ec2a4b..15554d79d 100644 --- a/test/lang/az.js +++ b/test/lang/az.js @@ -204,11 +204,11 @@ exports["lang:az"] = { 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(); }, @@ -217,7 +217,7 @@ exports["lang:az"] = { 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"); @@ -232,7 +232,7 @@ exports["lang:az"] = { 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"); @@ -245,14 +245,14 @@ exports["lang:az"] = { "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"); diff --git a/test/lang/bg.js b/test/lang/bg.js index addebcbe2..68f30f07c 100644 --- a/test/lang/bg.js +++ b/test/lang/bg.js @@ -180,11 +180,11 @@ exports["lang:bg"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:bg"] = { 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"); @@ -221,7 +221,7 @@ exports["lang:bg"] = { } 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"); @@ -232,14 +232,14 @@ exports["lang:bg"] = { }, "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"); diff --git a/test/lang/bn.js b/test/lang/bn.js index 8cfea88c6..487cb7f0d 100644 --- a/test/lang/bn.js +++ b/test/lang/bn.js @@ -65,7 +65,7 @@ exports["lang:bn"] = { ['ll', '১৪ ফেব ২০১০'], ['lll', '১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়'], ['llll', 'রবি, ১৪ ফেব ২০১০, দুপুর ৩:২৫ সময়'] - ], + ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; for (i = 0; i < a.length; i++) { @@ -192,11 +192,11 @@ exports["lang:bn"] = { 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) { @@ -204,7 +204,7 @@ exports["lang:bn"] = { 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"); @@ -220,7 +220,7 @@ exports["lang:bn"] = { 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"); @@ -232,14 +232,14 @@ exports["lang:bn"] = { "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"); diff --git a/test/lang/br.js b/test/lang/br.js index e41bc47a9..565293989 100644 --- a/test/lang/br.js +++ b/test/lang/br.js @@ -184,11 +184,11 @@ exports["lang:br"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:br"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:br"] = { 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"); @@ -224,14 +224,14 @@ exports["lang:br"] = { "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"); diff --git a/test/lang/bs.js b/test/lang/bs.js index 19018d8b0..4aafd2449 100644 --- a/test/lang/bs.js +++ b/test/lang/bs.js @@ -181,11 +181,11 @@ exports["lang:bs"] = { 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(); }, @@ -210,7 +210,7 @@ exports["lang:bs"] = { } 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"); @@ -240,7 +240,7 @@ exports["lang:bs"] = { } 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"); @@ -252,14 +252,14 @@ exports["lang:bs"] = { "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"); diff --git a/test/lang/ca.js b/test/lang/ca.js index 03c95fa23..b1bba3739 100644 --- a/test/lang/ca.js +++ b/test/lang/ca.js @@ -148,12 +148,12 @@ exports["lang:ca"] = { 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(); }, @@ -161,7 +161,7 @@ exports["lang:ca"] = { 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"); @@ -175,7 +175,7 @@ exports["lang:ca"] = { 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"); @@ -186,14 +186,14 @@ exports["lang:ca"] = { }, "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"); diff --git a/test/lang/cs.js b/test/lang/cs.js index 0640afd91..594e50234 100644 --- a/test/lang/cs.js +++ b/test/lang/cs.js @@ -214,11 +214,11 @@ exports["lang:cs"] = { 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(); }, @@ -226,7 +226,7 @@ exports["lang:cs"] = { 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: @@ -264,7 +264,7 @@ exports["lang:cs"] = { 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: @@ -299,14 +299,14 @@ exports["lang:cs"] = { }, "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"); diff --git a/test/lang/cv.js b/test/lang/cv.js index 4d398b792..18f38d138 100644 --- a/test/lang/cv.js +++ b/test/lang/cv.js @@ -186,11 +186,11 @@ exports["lang:cv"] = { "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(); }, @@ -199,7 +199,7 @@ exports["lang:cv"] = { 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"); @@ -214,7 +214,7 @@ exports["lang:cv"] = { 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"); @@ -225,14 +225,14 @@ exports["lang:cv"] = { }, "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"); diff --git a/test/lang/cy.js b/test/lang/cy.js index 2048869f0..3f41b249c 100644 --- a/test/lang/cy.js +++ b/test/lang/cy.js @@ -184,11 +184,11 @@ exports["lang:cy"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:cy"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:cy"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:cy"] = { }, "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"); diff --git a/test/lang/de-at.js b/test/lang/de-at.js index 1b3028014..5311e0577 100644 --- a/test/lang/de-at.js +++ b/test/lang/de-at.js @@ -189,11 +189,11 @@ exports["lang:de-at"] = { 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(); }, @@ -202,7 +202,7 @@ exports["lang:de-at"] = { 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"); @@ -217,7 +217,7 @@ exports["lang:de-at"] = { 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"); @@ -230,14 +230,14 @@ exports["lang:de-at"] = { "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"); diff --git a/test/lang/de.js b/test/lang/de.js index a669c8ac9..394062840 100644 --- a/test/lang/de.js +++ b/test/lang/de.js @@ -180,11 +180,11 @@ exports["lang:de"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:de"] = { 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"); @@ -206,7 +206,7 @@ exports["lang:de"] = { 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"); @@ -218,14 +218,14 @@ exports["lang:de"] = { "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"); diff --git a/test/lang/el.js b/test/lang/el.js index 46ddd0569..0b731875d 100644 --- a/test/lang/el.js +++ b/test/lang/el.js @@ -207,11 +207,11 @@ exports["lang:el"] = { 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(); }, @@ -220,7 +220,7 @@ exports["lang:el"] = { 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"); @@ -232,10 +232,10 @@ exports["lang:el"] = { "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"); @@ -249,14 +249,14 @@ exports["lang:el"] = { "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"); diff --git a/test/lang/en-au.js b/test/lang/en-au.js index a130f99e2..0edaf18f4 100644 --- a/test/lang/en-au.js +++ b/test/lang/en-au.js @@ -180,11 +180,11 @@ exports["lang:en-au"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:en-au"] = { 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"); @@ -207,7 +207,7 @@ exports["lang:en-au"] = { 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"); @@ -219,14 +219,14 @@ exports["lang:en-au"] = { "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"); diff --git a/test/lang/en-ca.js b/test/lang/en-ca.js index 2093948f0..60f0f4d21 100644 --- a/test/lang/en-ca.js +++ b/test/lang/en-ca.js @@ -205,11 +205,11 @@ exports["lang:en-ca"] = { 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(); }, @@ -218,7 +218,7 @@ exports["lang:en-ca"] = { 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"); @@ -233,7 +233,7 @@ exports["lang:en-ca"] = { 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"); @@ -245,14 +245,14 @@ exports["lang:en-ca"] = { "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"); diff --git a/test/lang/en-gb.js b/test/lang/en-gb.js index 4b9a2b53b..0fc81337c 100644 --- a/test/lang/en-gb.js +++ b/test/lang/en-gb.js @@ -180,11 +180,11 @@ exports["lang:en-gb"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:en-gb"] = { 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"); @@ -207,7 +207,7 @@ exports["lang:en-gb"] = { 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"); @@ -219,14 +219,14 @@ exports["lang:en-gb"] = { "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"); diff --git a/test/lang/en.js b/test/lang/en.js index 8be2301d7..68700d69b 100644 --- a/test/lang/en.js +++ b/test/lang/en.js @@ -205,11 +205,11 @@ exports["lang:en"] = { 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(); }, @@ -219,7 +219,7 @@ exports["lang:en"] = { 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"); @@ -234,7 +234,7 @@ exports["lang:en"] = { 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"); @@ -246,14 +246,14 @@ exports["lang:en"] = { "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"); @@ -347,7 +347,6 @@ exports["lang:en"] = { }, "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"); diff --git a/test/lang/eo.js b/test/lang/eo.js index b5d43014d..5099c29c9 100644 --- a/test/lang/eo.js +++ b/test/lang/eo.js @@ -186,11 +186,11 @@ exports["lang:eo"] = { 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(); }, @@ -199,7 +199,7 @@ exports["lang:eo"] = { 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"); @@ -214,7 +214,7 @@ exports["lang:eo"] = { 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"); @@ -226,14 +226,14 @@ exports["lang:eo"] = { "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"); diff --git a/test/lang/es.js b/test/lang/es.js index 955ec62cb..6eb9592a4 100644 --- a/test/lang/es.js +++ b/test/lang/es.js @@ -181,12 +181,12 @@ exports["lang:es"] = { 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(); }, @@ -195,7 +195,7 @@ exports["lang:es"] = { 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"); @@ -210,7 +210,7 @@ exports["lang:es"] = { 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"); @@ -222,14 +222,14 @@ exports["lang:es"] = { "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"); diff --git a/test/lang/et.js b/test/lang/et.js index caf417474..33dfd0cc6 100644 --- a/test/lang/et.js +++ b/test/lang/et.js @@ -213,11 +213,11 @@ exports["lang:et"] = { 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(); }, @@ -225,7 +225,7 @@ exports["lang:et"] = { 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"); @@ -239,7 +239,7 @@ exports["lang:et"] = { 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"); @@ -251,14 +251,14 @@ exports["lang:et"] = { "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"); diff --git a/test/lang/eu.js b/test/lang/eu.js index 9ad6dad25..72e91feea 100644 --- a/test/lang/eu.js +++ b/test/lang/eu.js @@ -186,11 +186,11 @@ exports["lang:eu"] = { 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(); }, @@ -198,7 +198,7 @@ exports["lang:eu"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:eu"] = { 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"); @@ -224,14 +224,14 @@ exports["lang:eu"] = { "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"); diff --git a/test/lang/fa.js b/test/lang/fa.js index cf96fb472..e6e496dc4 100644 --- a/test/lang/fa.js +++ b/test/lang/fa.js @@ -170,11 +170,11 @@ exports["lang:fa"] = { 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(); }, @@ -182,7 +182,7 @@ exports["lang:fa"] = { 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"); @@ -196,7 +196,7 @@ exports["lang:fa"] = { 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"); @@ -207,14 +207,14 @@ exports["lang:fa"] = { }, "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"); diff --git a/test/lang/fi.js b/test/lang/fi.js index 1fe57af36..54cee1626 100644 --- a/test/lang/fi.js +++ b/test/lang/fi.js @@ -180,11 +180,11 @@ exports["lang:fi"] = { 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(); }, @@ -193,7 +193,7 @@ exports["lang:fi"] = { 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"); @@ -207,7 +207,7 @@ exports["lang:fi"] = { 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"); @@ -219,14 +219,14 @@ exports["lang:fi"] = { "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ä"); diff --git a/test/lang/fr-ca.js b/test/lang/fr-ca.js index f7b4fa780..a0b5fcbd3 100644 --- a/test/lang/fr-ca.js +++ b/test/lang/fr-ca.js @@ -199,11 +199,11 @@ exports["lang:fr-ca"] = { 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(); }, @@ -212,7 +212,7 @@ exports["lang:fr-ca"] = { 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"); @@ -227,7 +227,7 @@ exports["lang:fr-ca"] = { 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"); @@ -239,14 +239,14 @@ exports["lang:fr-ca"] = { "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"); diff --git a/test/lang/fr.js b/test/lang/fr.js index 754d0bc63..8f10ffb79 100644 --- a/test/lang/fr.js +++ b/test/lang/fr.js @@ -184,11 +184,11 @@ exports["lang:fr"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:fr"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:fr"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:fr"] = { }, "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"); diff --git a/test/lang/gl.js b/test/lang/gl.js index 1df38913f..08e42da24 100644 --- a/test/lang/gl.js +++ b/test/lang/gl.js @@ -155,12 +155,12 @@ exports["lang:gl"] = { 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(); }, @@ -169,7 +169,7 @@ exports["lang:gl"] = { 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"); @@ -183,7 +183,7 @@ exports["lang:gl"] = { 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"); @@ -195,14 +195,14 @@ exports["lang:gl"] = { "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"); @@ -211,7 +211,7 @@ exports["lang:gl"] = { "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(); diff --git a/test/lang/he.js b/test/lang/he.js index 16e1ac6b1..288d2683f 100644 --- a/test/lang/he.js +++ b/test/lang/he.js @@ -144,11 +144,11 @@ exports["lang:he"] = { 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(); }, @@ -156,7 +156,7 @@ exports["lang:he"] = { 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"); @@ -170,7 +170,7 @@ exports["lang:he"] = { 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"); @@ -182,14 +182,14 @@ exports["lang:he"] = { "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"); diff --git a/test/lang/hi.js b/test/lang/hi.js index f075a4385..456207ad5 100644 --- a/test/lang/hi.js +++ b/test/lang/hi.js @@ -185,11 +185,11 @@ exports["lang:hi"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:hi"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:hi"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:hi"] = { }, "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"); diff --git a/test/lang/hr.js b/test/lang/hr.js index e004912e5..4eb294ef4 100644 --- a/test/lang/hr.js +++ b/test/lang/hr.js @@ -181,11 +181,11 @@ exports["lang:hr"] = { 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(); }, @@ -210,7 +210,7 @@ exports["lang:hr"] = { } 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"); @@ -240,7 +240,7 @@ exports["lang:hr"] = { } 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"); @@ -252,14 +252,14 @@ exports["lang:hr"] = { "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"); diff --git a/test/lang/hu.js b/test/lang/hu.js index ce6b0f85c..62748c044 100644 --- a/test/lang/hu.js +++ b/test/lang/hu.js @@ -198,11 +198,11 @@ exports["lang:hu"] = { 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(); }, @@ -210,7 +210,7 @@ exports["lang:hu"] = { 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"); @@ -226,7 +226,7 @@ exports["lang:hu"] = { 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"); @@ -239,14 +239,14 @@ exports["lang:hu"] = { "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"); diff --git a/test/lang/hy-am.js b/test/lang/hy-am.js index 2921503cd..b516241b2 100644 --- a/test/lang/hy-am.js +++ b/test/lang/hy-am.js @@ -257,11 +257,11 @@ exports["lang:hy-am"] = { 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(); }, @@ -273,7 +273,7 @@ exports["lang:hy-am"] = { } 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"); @@ -292,7 +292,7 @@ exports["lang:hy-am"] = { } 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"); @@ -304,14 +304,14 @@ exports["lang:hy-am"] = { "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"); diff --git a/test/lang/id.js b/test/lang/id.js index b1c8d329c..86b5c59e0 100644 --- a/test/lang/id.js +++ b/test/lang/id.js @@ -142,11 +142,11 @@ exports["lang:id"] = { 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(); }, @@ -154,7 +154,7 @@ exports["lang:id"] = { 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"); @@ -168,7 +168,7 @@ exports["lang:id"] = { 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"); @@ -180,14 +180,14 @@ exports["lang:id"] = { "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"); diff --git a/test/lang/is.js b/test/lang/is.js index a2f6854fe..bd20b3731 100644 --- a/test/lang/is.js +++ b/test/lang/is.js @@ -192,11 +192,11 @@ exports["lang:is"] = { 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(); }, @@ -204,7 +204,7 @@ exports["lang:is"] = { 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"); @@ -219,7 +219,7 @@ exports["lang:is"] = { 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"); @@ -231,14 +231,14 @@ exports["lang:is"] = { "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"); diff --git a/test/lang/it.js b/test/lang/it.js index 471acfd22..eafae2338 100644 --- a/test/lang/it.js +++ b/test/lang/it.js @@ -183,11 +183,11 @@ exports["lang:it"] = { 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(); }, @@ -195,7 +195,7 @@ exports["lang:it"] = { 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"); @@ -209,7 +209,7 @@ exports["lang:it"] = { 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"); @@ -221,14 +221,14 @@ exports["lang:it"] = { "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"); diff --git a/test/lang/ja.js b/test/lang/ja.js index 49139b587..6b71da6e5 100644 --- a/test/lang/ja.js +++ b/test/lang/ja.js @@ -147,11 +147,11 @@ exports["lang:ja"] = { 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(); }, @@ -159,7 +159,7 @@ exports["lang:ja"] = { 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"); @@ -173,7 +173,7 @@ exports["lang:ja"] = { 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"); @@ -185,14 +185,14 @@ exports["lang:ja"] = { "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"); diff --git a/test/lang/ka.js b/test/lang/ka.js index 5ba855381..5136c7bdc 100644 --- a/test/lang/ka.js +++ b/test/lang/ka.js @@ -208,11 +208,11 @@ exports["lang:ka"] = { 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(); }, @@ -221,7 +221,7 @@ exports["lang:ka"] = { 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 + " დღე დღის დასაწყისში"); @@ -235,7 +235,7 @@ exports["lang:ka"] = { 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 + " დღე დღის დასაწყისში"); @@ -247,14 +247,14 @@ exports["lang:ka"] = { "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 კვირაში"); diff --git a/test/lang/km.js b/test/lang/km.js index 3b09774d2..0c37e3ba7 100644 --- a/test/lang/km.js +++ b/test/lang/km.js @@ -39,29 +39,29 @@ exports["lang:km"] = { "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++) { @@ -128,34 +128,34 @@ exports["lang:km"] = { "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(); }, @@ -239,8 +239,8 @@ exports["lang:km"] = { "calendar all else": function (test) { var weeksAgo = moment().subtract({ - w: 1 - }), + w: 1 + }), weeksFromNow = moment().add({ w: 1 }); diff --git a/test/lang/ko.js b/test/lang/ko.js index 07bc491fd..138c7a21e 100644 --- a/test/lang/ko.js +++ b/test/lang/ko.js @@ -231,11 +231,11 @@ exports["lang:ko"] = { 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(); }, @@ -243,7 +243,7 @@ exports["lang:ko"] = { 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"); @@ -257,7 +257,7 @@ exports["lang:ko"] = { 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"); @@ -269,14 +269,14 @@ exports["lang:ko"] = { "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"); diff --git a/test/lang/lb.js b/test/lang/lb.js index 9d9c03a60..b693e1581 100644 --- a/test/lang/lb.js +++ b/test/lang/lb.js @@ -152,7 +152,7 @@ exports["lang:lb"] = { 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); diff --git a/test/lang/lt.js b/test/lang/lt.js index 210940771..2b03b3a1f 100644 --- a/test/lang/lt.js +++ b/test/lang/lt.js @@ -204,11 +204,11 @@ exports["lang:lt"] = { 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(); }, @@ -216,7 +216,7 @@ exports["lang:lt"] = { 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"); @@ -230,7 +230,7 @@ exports["lang:lt"] = { 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"); @@ -241,14 +241,14 @@ exports["lang:lt"] = { }, "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"); diff --git a/test/lang/lv.js b/test/lang/lv.js index 7cd812f9d..fc70b8cc7 100644 --- a/test/lang/lv.js +++ b/test/lang/lv.js @@ -186,11 +186,11 @@ exports["lang:lv"] = { 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(); }, @@ -198,7 +198,7 @@ exports["lang:lv"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:lv"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:lv"] = { }, "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"); diff --git a/test/lang/mk.js b/test/lang/mk.js index 07469886a..d756d5434 100644 --- a/test/lang/mk.js +++ b/test/lang/mk.js @@ -180,11 +180,11 @@ exports["lang:mk"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:mk"] = { 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"); @@ -221,7 +221,7 @@ exports["lang:mk"] = { } 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"); @@ -232,14 +232,14 @@ exports["lang:mk"] = { }, "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"); diff --git a/test/lang/ml.js b/test/lang/ml.js index b3ce061c5..b07f308ec 100644 --- a/test/lang/ml.js +++ b/test/lang/ml.js @@ -185,11 +185,11 @@ exports["lang:ml"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:ml"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:ml"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:ml"] = { }, "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"); diff --git a/test/lang/mr.js b/test/lang/mr.js index b2d5e538a..db6d094c6 100644 --- a/test/lang/mr.js +++ b/test/lang/mr.js @@ -136,7 +136,7 @@ exports["lang:mr"] = { 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"); @@ -148,18 +148,18 @@ exports["lang:mr"] = { 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(); }, @@ -175,8 +175,8 @@ exports["lang:mr"] = { }, "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(); }, @@ -185,11 +185,11 @@ exports["lang:mr"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:mr"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:mr"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:mr"] = { }, "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"); diff --git a/test/lang/ms-my.js b/test/lang/ms-my.js index 1224c98ff..3101d796f 100644 --- a/test/lang/ms-my.js +++ b/test/lang/ms-my.js @@ -205,11 +205,11 @@ exports["lang:ms-my"] = { 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(); }, @@ -218,7 +218,7 @@ exports["lang:ms-my"] = { 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"); @@ -232,7 +232,7 @@ exports["lang:ms-my"] = { 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"); @@ -244,14 +244,14 @@ exports["lang:ms-my"] = { "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"); diff --git a/test/lang/nb.js b/test/lang/nb.js index feb554c5e..29837b74b 100644 --- a/test/lang/nb.js +++ b/test/lang/nb.js @@ -187,11 +187,11 @@ exports["lang:nb"] = { 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(); }, @@ -199,7 +199,7 @@ exports["lang:nb"] = { 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"); @@ -213,7 +213,7 @@ exports["lang:nb"] = { 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"); @@ -224,14 +224,14 @@ exports["lang:nb"] = { }, "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"); diff --git a/test/lang/ne.js b/test/lang/ne.js index e8b1d0aee..baec130b8 100644 --- a/test/lang/ne.js +++ b/test/lang/ne.js @@ -185,11 +185,11 @@ exports["lang:ne"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:ne"] = { 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"); @@ -211,7 +211,7 @@ exports["lang:ne"] = { 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"); @@ -222,14 +222,14 @@ exports["lang:ne"] = { }, "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"); diff --git a/test/lang/nl.js b/test/lang/nl.js index bd8ca55db..7abdfc98a 100644 --- a/test/lang/nl.js +++ b/test/lang/nl.js @@ -186,11 +186,11 @@ exports["lang:nl"] = { 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(); }, @@ -198,7 +198,7 @@ exports["lang:nl"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:nl"] = { 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"); @@ -224,14 +224,14 @@ exports["lang:nl"] = { "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"); diff --git a/test/lang/nn.js b/test/lang/nn.js index a8cdd3456..284814494 100644 --- a/test/lang/nn.js +++ b/test/lang/nn.js @@ -186,11 +186,11 @@ exports["lang:nn"] = { 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(); }, @@ -198,7 +198,7 @@ exports["lang:nn"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:nn"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:nn"] = { }, "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"); diff --git a/test/lang/pl.js b/test/lang/pl.js index cc36c1a2f..15f7f87b5 100644 --- a/test/lang/pl.js +++ b/test/lang/pl.js @@ -191,11 +191,11 @@ exports["lang:pl"] = { 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(); }, @@ -203,7 +203,7 @@ exports["lang:pl"] = { 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"); @@ -231,7 +231,7 @@ exports["lang:pl"] = { } 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); @@ -245,14 +245,14 @@ exports["lang:pl"] = { "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"); diff --git a/test/lang/pt-br.js b/test/lang/pt-br.js index d672988bb..fa0762eea 100644 --- a/test/lang/pt-br.js +++ b/test/lang/pt-br.js @@ -187,11 +187,11 @@ exports["lang:pt-br"] = { 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(); }, @@ -199,7 +199,7 @@ exports["lang:pt-br"] = { 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"); @@ -213,7 +213,7 @@ exports["lang:pt-br"] = { 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"); @@ -225,14 +225,14 @@ exports["lang:pt-br"] = { "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"); diff --git a/test/lang/pt.js b/test/lang/pt.js index 261811f2d..1d3dc7fa5 100644 --- a/test/lang/pt.js +++ b/test/lang/pt.js @@ -177,11 +177,11 @@ exports["lang:pt"] = { 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(); }, @@ -189,7 +189,7 @@ exports["lang:pt"] = { 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"); @@ -203,7 +203,7 @@ exports["lang:pt"] = { 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"); @@ -215,14 +215,14 @@ exports["lang:pt"] = { "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"); diff --git a/test/lang/ro.js b/test/lang/ro.js index 4a42d6ccc..f1fd228f4 100644 --- a/test/lang/ro.js +++ b/test/lang/ro.js @@ -194,11 +194,11 @@ exports["lang:ro"] = { 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(); }, @@ -206,7 +206,7 @@ exports["lang:ro"] = { 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"); @@ -220,7 +220,7 @@ exports["lang:ro"] = { 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"); @@ -231,14 +231,14 @@ exports["lang:ro"] = { }, "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"); diff --git a/test/lang/ru.js b/test/lang/ru.js index 743d16c23..d427bf17d 100644 --- a/test/lang/ru.js +++ b/test/lang/ru.js @@ -260,11 +260,11 @@ exports["lang:ru"] = { 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(); }, @@ -276,7 +276,7 @@ exports["lang:ru"] = { } 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"); @@ -306,7 +306,7 @@ exports["lang:ru"] = { } 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"); @@ -318,14 +318,14 @@ exports["lang:ru"] = { "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"); diff --git a/test/lang/sk.js b/test/lang/sk.js index a49315ebe..1e022c529 100644 --- a/test/lang/sk.js +++ b/test/lang/sk.js @@ -214,11 +214,11 @@ exports["lang:sk"] = { 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(); }, @@ -226,7 +226,7 @@ exports["lang:sk"] = { 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: @@ -264,7 +264,7 @@ exports["lang:sk"] = { 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: @@ -299,14 +299,14 @@ exports["lang:sk"] = { }, "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"); diff --git a/test/lang/sl.js b/test/lang/sl.js index d0dd8a611..92fd1f1a1 100644 --- a/test/lang/sl.js +++ b/test/lang/sl.js @@ -181,11 +181,11 @@ exports["lang:sl"] = { 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(); }, @@ -210,7 +210,7 @@ exports["lang:sl"] = { } 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"); @@ -239,7 +239,7 @@ exports["lang:sl"] = { } 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"); @@ -251,14 +251,14 @@ exports["lang:sl"] = { "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"); diff --git a/test/lang/sq.js b/test/lang/sq.js index f29dfb4a6..6f17032e8 100644 --- a/test/lang/sq.js +++ b/test/lang/sq.js @@ -213,11 +213,11 @@ exports["lang:sq"] = { 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(); }, @@ -227,7 +227,7 @@ exports["lang:sq"] = { 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"); @@ -242,7 +242,7 @@ exports["lang:sq"] = { 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"); @@ -254,14 +254,14 @@ exports["lang:sq"] = { "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"); diff --git a/test/lang/sr-cyrl.js b/test/lang/sr-cyrl.js index 35acccdfe..55c30e7c2 100644 --- a/test/lang/sr-cyrl.js +++ b/test/lang/sr-cyrl.js @@ -184,11 +184,11 @@ exports["lang:sr-cyrl"] = { 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(); }, @@ -213,7 +213,7 @@ exports["lang:sr-cyrl"] = { } 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"); @@ -242,7 +242,7 @@ exports["lang:sr-cyrl"] = { } 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"); @@ -254,14 +254,14 @@ exports["lang:sr-cyrl"] = { "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"); diff --git a/test/lang/sr.js b/test/lang/sr.js index 79591d04e..a0c77f2f7 100644 --- a/test/lang/sr.js +++ b/test/lang/sr.js @@ -184,11 +184,11 @@ exports["lang:sr"] = { 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(); }, @@ -213,7 +213,7 @@ exports["lang:sr"] = { } 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"); @@ -242,7 +242,7 @@ exports["lang:sr"] = { } 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"); @@ -254,14 +254,14 @@ exports["lang:sr"] = { "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"); diff --git a/test/lang/sv.js b/test/lang/sv.js index 51edfd567..dc3c77d13 100644 --- a/test/lang/sv.js +++ b/test/lang/sv.js @@ -179,11 +179,11 @@ exports["lang:sv"] = { 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(); }, @@ -191,7 +191,7 @@ exports["lang:sv"] = { 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"); @@ -205,7 +205,7 @@ exports["lang:sv"] = { 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"); @@ -216,14 +216,14 @@ exports["lang:sv"] = { }, "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"); diff --git a/test/lang/ta.js b/test/lang/ta.js index d9ca4eea2..6c5a469c0 100644 --- a/test/lang/ta.js +++ b/test/lang/ta.js @@ -180,11 +180,11 @@ exports["lang:ta"] = { 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(); }, @@ -192,7 +192,7 @@ exports["lang:ta"] = { 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"); @@ -207,7 +207,7 @@ exports["lang:ta"] = { 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"); @@ -220,14 +220,14 @@ exports["lang:ta"] = { "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"); diff --git a/test/lang/th.js b/test/lang/th.js index 13da803f2..9a5c884ff 100644 --- a/test/lang/th.js +++ b/test/lang/th.js @@ -147,11 +147,11 @@ exports["lang:th"] = { 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(); }, @@ -159,7 +159,7 @@ exports["lang:th"] = { 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"); @@ -173,7 +173,7 @@ exports["lang:th"] = { 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"); @@ -185,14 +185,14 @@ exports["lang:th"] = { "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"); diff --git a/test/lang/tl-ph.js b/test/lang/tl-ph.js index 7da00486f..0f2a4c31b 100644 --- a/test/lang/tl-ph.js +++ b/test/lang/tl-ph.js @@ -184,11 +184,11 @@ exports["lang:tl-ph"] = { 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(); }, @@ -197,7 +197,7 @@ exports["lang:tl-ph"] = { 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"); @@ -212,7 +212,7 @@ exports["lang:tl-ph"] = { 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"); @@ -223,14 +223,14 @@ exports["lang:tl-ph"] = { }, "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"); diff --git a/test/lang/tr.js b/test/lang/tr.js index 388edbf37..5e2f14ea3 100644 --- a/test/lang/tr.js +++ b/test/lang/tr.js @@ -196,11 +196,11 @@ exports["lang:tr"] = { 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(); }, @@ -208,7 +208,7 @@ exports["lang:tr"] = { 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"); @@ -222,7 +222,7 @@ exports["lang:tr"] = { 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"); @@ -234,14 +234,14 @@ exports["lang:tr"] = { "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"); diff --git a/test/lang/tzm-latn.js b/test/lang/tzm-latn.js index efedb58ab..9b249f7aa 100644 --- a/test/lang/tzm-latn.js +++ b/test/lang/tzm-latn.js @@ -187,11 +187,11 @@ exports["lang:tzm-latn"] = { 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(); }, @@ -199,7 +199,7 @@ exports["lang:tzm-latn"] = { 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"); @@ -213,7 +213,7 @@ exports["lang:tzm-latn"] = { 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"); @@ -224,14 +224,14 @@ exports["lang:tzm-latn"] = { }, "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"); diff --git a/test/lang/tzm.js b/test/lang/tzm.js index 566592b77..25f9e7d40 100644 --- a/test/lang/tzm.js +++ b/test/lang/tzm.js @@ -178,11 +178,11 @@ exports["lang:tzm"] = { 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(); }, @@ -190,7 +190,7 @@ exports["lang:tzm"] = { 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"); @@ -204,7 +204,7 @@ exports["lang:tzm"] = { 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"); @@ -215,14 +215,14 @@ exports["lang:tzm"] = { }, "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"); diff --git a/test/lang/uk.js b/test/lang/uk.js index 7cfe4ec7a..8ec46ef07 100644 --- a/test/lang/uk.js +++ b/test/lang/uk.js @@ -199,13 +199,13 @@ exports["lang:uk"] = { 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(); }, @@ -213,7 +213,7 @@ exports["lang:uk"] = { 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"); @@ -242,7 +242,7 @@ exports["lang:uk"] = { } 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"); @@ -253,14 +253,14 @@ exports["lang:uk"] = { }, "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"); diff --git a/test/lang/uz.js b/test/lang/uz.js index 27dfd1d91..12f36f4e5 100644 --- a/test/lang/uz.js +++ b/test/lang/uz.js @@ -181,11 +181,11 @@ exports["lang:uz"] = { 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(); }, @@ -193,7 +193,7 @@ exports["lang:uz"] = { 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"); @@ -208,7 +208,7 @@ exports["lang:uz"] = { 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"); @@ -220,14 +220,14 @@ exports["lang:uz"] = { "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"); diff --git a/test/lang/vi.js b/test/lang/vi.js index 4a969986c..71bfac6f1 100644 --- a/test/lang/vi.js +++ b/test/lang/vi.js @@ -205,11 +205,11 @@ exports["lang:vi"] = { 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(); }, @@ -219,7 +219,7 @@ exports["lang:vi"] = { 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"); @@ -234,7 +234,7 @@ exports["lang:vi"] = { 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"); @@ -246,14 +246,14 @@ exports["lang:vi"] = { "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"); diff --git a/test/lang/zh-cn.js b/test/lang/zh-cn.js index c48e1e002..94b0b5cfc 100644 --- a/test/lang/zh-cn.js +++ b/test/lang/zh-cn.js @@ -162,11 +162,11 @@ exports["lang:zh-cn"] = { 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(); }, @@ -175,7 +175,7 @@ exports["lang:zh-cn"] = { 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 } @@ -189,7 +189,7 @@ exports["lang:zh-cn"] = { 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; } @@ -206,7 +206,7 @@ exports["lang:zh-cn"] = { 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; } @@ -217,14 +217,14 @@ exports["lang:zh-cn"] = { "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"); diff --git a/test/lang/zh-tw.js b/test/lang/zh-tw.js index cff82a802..8bd5ab78c 100644 --- a/test/lang/zh-tw.js +++ b/test/lang/zh-tw.js @@ -160,11 +160,11 @@ exports["lang:zh-tw"] = { 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(); }, @@ -173,7 +173,7 @@ exports["lang:zh-tw"] = { 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"); @@ -188,7 +188,7 @@ exports["lang:zh-tw"] = { 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"); @@ -201,14 +201,14 @@ exports["lang:zh-tw"] = { "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"); diff --git a/test/moment/create.js b/test/moment/create.js index b8c4a9a55..854852157 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -1,16 +1,16 @@ -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) { @@ -402,7 +402,7 @@ exports.create = { 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'); @@ -665,10 +665,10 @@ exports.create = { "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]); @@ -722,7 +722,7 @@ exports.create = { "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"); diff --git a/test/moment/format.js b/test/moment/format.js index 095f9ca6e..c84a8a8b5 100644 --- a/test/moment/format.js +++ b/test/moment/format.js @@ -364,7 +364,11 @@ exports.format = { "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(); @@ -375,14 +379,14 @@ exports.format = { 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"); } diff --git a/test/moment/getters_setters.js b/test/moment/getters_setters.js index 59ac5c2da..1fd1d22b8 100644 --- a/test/moment/getters_setters.js +++ b/test/moment/getters_setters.js @@ -156,7 +156,7 @@ exports.gettersSetters = { // 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) { @@ -170,7 +170,7 @@ exports.gettersSetters = { // test.equals(a.day(), 4); // test.done(); - // }, + //}, "setters strings" : function (test) { test.expect(7); diff --git a/test/moment/mutable.js b/test/moment/mutable.js index e2934c1ef..17c9fc452 100644 --- a/test/moment/mutable.js +++ b/test/moment/mutable.js @@ -9,54 +9,28 @@ exports.mutable = { }, "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(); } - }; diff --git a/test/moment/preparse_postformat.js b/test/moment/preparse_postformat.js index 5e38f8758..3dd0841f2 100644 --- a/test/moment/preparse_postformat.js +++ b/test/moment/preparse_postformat.js @@ -1,45 +1,44 @@ -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) { @@ -84,11 +83,11 @@ exports.preparsePostformat = { 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(); } diff --git a/test/moment/string_prototype.js b/test/moment/string_prototype.js index 3a8611fdb..42c8d79e3 100644 --- a/test/moment/string_prototype.js +++ b/test/moment/string_prototype.js @@ -13,7 +13,9 @@ exports.stringPrototype = { 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'); -- 2.47.2