config._d = new Date(+input);
} else if (typeof(input) === 'object') {
dateFromObject(config);
- } else {
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
config._d = new Date(input);
+ } else {
+ moment.createFromInputFallback(config);
}
}
return makeMoment(c);
};
+ moment.createFromInputFallback = function (config) {
+ config._d = new Date(config._i);
+ };
+
// creating with utc
moment.utc = function (input, format, lang, strict) {
var c;
exports["lang:ar-ma"] = {
setUp : function (cb) {
moment.lang('ar-ma');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:ar"] = {
setUp : function (cb) {
moment.lang('ar');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:bg"] = {
setUp : function (cb) {
moment.lang('bg');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:br"] = {
setUp : function (cb) {
moment.lang('br');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.equal(start.from(moment([2007, 1, 28]).add({y: 261}), true), "261 bloaz", "mutation 261 years");
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/br'), 'br', "module should export br");
}
-
+
test.done();
}
};
exports["lang:bs"] = {
setUp : function (cb) {
moment.lang('bs');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:ca"] = {
setUp : function (cb) {
moment.lang('ca');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ca'), 'ca', "module should export ca");
}
-
+
test.done();
}
};
exports["lang:cs"] = {
setUp : function (cb) {
moment.lang('cs');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:cv"] = {
setUp : function (cb) {
moment.lang('cv');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/cv'), 'cv', "module should export cv");
}
-
+
test.done();
}
};
exports["lang:cy"] = {
setUp : function (cb) {
moment.lang('cy');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/cy'), 'cy', "module should export cy");
}
-
+
test.done();
}
};
exports["lang:da"] = {
setUp : function (cb) {
moment.lang('da');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/da'), 'da', "module should export da");
}
-
+
test.done();
}
};
exports["lang:de"] = {
setUp : function (cb) {
moment.lang('de');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/de'), 'de', "module should export de");
}
-
+
test.done();
}
};
exports["lang:el"] = {
setUp : function (cb) {
moment.lang('el');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/el'), 'el', "module should export el");
}
-
+
test.done();
}
};
exports["lang:en-au"] = {
setUp : function (cb) {
moment.lang('en-au');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:en-ca"] = {
setUp : function (cb) {
moment.lang('en-ca');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/en-ca'), 'en-ca', "module should export en-ca");
}
-
+
test.done();
}
};
exports["lang:en-gb"] = {
setUp : function (cb) {
moment.lang('en-gb');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:en"] = {
setUp : function (cb) {
moment.lang('en');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:eo"] = {
setUp : function (cb) {
moment.lang('eo');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/eo'), 'eo', "module should export eo");
}
-
+
test.done();
}
};
exports["lang:es"] = {
setUp : function (cb) {
moment.lang('es');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:et"] = {
setUp : function (cb) {
moment.lang('et');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.equal(moment().add({s: 30}).fromNow(), "mõne sekundi pärast", "in a few seconds");
test.equal(moment().subtract({s: 30}).fromNow(), "mõni sekund tagasi", "a few seconds ago");
-
+
test.equal(moment().add({m: 1}).fromNow(), "ühe minuti pärast", "in a minute");
test.equal(moment().subtract({m: 1}).fromNow(), "üks minut tagasi", "a minute ago");
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/et'), 'et', "module should export et");
}
-
+
test.done();
}
};
exports["lang:eu"] = {
setUp : function (cb) {
moment.lang('eu');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/eu'), 'eu', "module should export eu");
}
-
+
test.done();
}
};
exports["lang:fa"] = {
setUp : function (cb) {
moment.lang('fa');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/fa'), 'fa', "module should export fa");
}
-
+
test.done();
}
};
exports["lang:fi"] = {
setUp : function (cb) {
moment.lang('fi');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/fi'), 'fi', "module should export fi");
}
-
+
test.done();
}
};
exports["lang:fo"] = {
setUp : function (cb) {
moment.lang('fo');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/fo'), 'fo', "module should export fo");
}
-
+
test.done();
}
};
exports["lang:fr-ca"] = {
setUp : function (cb) {
moment.lang('fr-ca');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/fr-ca'), 'fr-ca', "module should export fr-ca");
}
-
+
test.done();
}
};
exports["lang:fr"] = {
setUp : function (cb) {
moment.lang('fr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/fr'), 'fr', "module should export fr");
}
-
+
test.done();
}
};
exports["lang:gl"] = {
setUp : function (cb) {
moment.lang('gl');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/gl'), 'gl', "module should export gl");
}
-
+
test.done();
}
};
exports["lang:he"] = {
setUp : function (cb) {
moment.lang('he');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/he'), 'he', "module should export he");
}
-
+
test.done();
}
};
exports["lang:hi"] = {
setUp : function (cb) {
moment.lang('hi');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/hi'), 'hi', "module should export hi");
}
-
+
test.done();
}
};
exports["lang:hr"] = {
setUp : function (cb) {
moment.lang('hr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/hr'), 'hr', "module should export hr");
}
-
+
test.done();
}
};
exports["lang:hu"] = {
setUp : function (cb) {
moment.lang('hu');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/hu'), 'hu', "module should export hu");
}
-
+
test.done();
}
};
exports["lang:hy-am"] = {
setUp : function (cb) {
moment.lang('hy-am');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/hy-am'), 'hy-am', "module should export hy");
}
-
+
test.done();
}
-
+
};
exports["lang:id"] = {
setUp : function (cb) {
moment.lang('id');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/id'), 'id', "module should export id");
}
-
+
test.done();
}
};
exports["lang:is"] = {
setUp : function (cb) {
moment.lang('is');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
-
+
test.equal(require('../../lang/is'), 'is', "module should export is");
}
-
+
test.done();
}
};
exports["lang:it"] = {
setUp : function (cb) {
moment.lang('it');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/it'), 'it', "module should export it");
}
-
+
test.done();
}
};
exports["lang:ja"] = {
setUp : function (cb) {
moment.lang('ja');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ja'), 'ja', "module should export ja");
}
-
+
test.done();
}
};
exports["lang:ka"] = {
setUp : function (cb) {
moment.lang('ka');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:kr"] = {
setUp : function (cb) {
moment.lang('ko');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:lb"] = {
setUp: function (cb) {
moment.lang('lb');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:lt"] = {
setUp : function (cb) {
moment.lang('lt');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/lt'), 'lt', "module should export lt");
}
-
+
test.done();
}
};
exports["lang:lv"] = {
setUp : function (cb) {
moment.lang('lv');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/lv'), 'lv', "module should export lv");
}
-
+
test.done();
}
};
exports["lang:mk"] = {
"setUp" : function (cb) {
moment.lang('mk');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:ml"] = {
setUp : function (cb) {
moment.lang('ml');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ml'), 'ml', "module should export ml");
}
-
+
test.done();
}
};
exports["lang:mr"] = {
setUp : function (cb) {
moment.lang('mr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/mr'), 'mr', "module should export mr");
}
-
+
test.done();
}
};
exports["lang:ms-my"] = {
setUp : function (cb) {
moment.lang('ms-my');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ms-my'), 'ms-my', "module should export ms-my");
}
-
+
test.done();
}
};
exports["lang:nb"] = {
setUp : function (cb) {
moment.lang('nb');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/nb'), 'nb', "module should export nb");
}
-
+
test.done();
}
};
exports["lang:ne"] = {
setUp : function (cb) {
moment.lang('ne');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ne'), 'ne', "module should export ne");
}
-
+
test.done();
}
};
exports["lang:nl"] = {
setUp : function (cb) {
moment.lang('nl');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/nl'), 'nl', "module should export nl");
}
-
+
test.done();
}
};
exports["lang:nn"] = {
setUp : function (cb) {
moment.lang('nn');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:pl"] = {
setUp : function (cb) {
moment.lang('pl');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/pl'), 'pl', "module should export pl");
}
-
+
test.done();
}
};
exports["lang:pt-br"] = {
setUp : function (cb) {
moment.lang('pt-br');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/pt-br'), 'pt-br', "module should export pt-br");
}
-
+
test.done();
}
};
exports["lang:pt"] = {
setUp : function (cb) {
moment.lang('pt');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/pt'), 'pt', "module should export pt");
}
-
+
test.done();
}
};
exports["lang:ro"] = {
setUp : function (cb) {
moment.lang('ro');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ro'), 'ro', "module should export ro");
}
-
+
test.done();
}
};
exports["lang:ru"] = {
setUp : function (cb) {
moment.lang('ru');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/ru'), 'ru', "module should export ru");
}
-
+
test.done();
}
};
exports["lang:sk"] = {
setUp : function (cb) {
moment.lang('sk');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/sk'), 'sk', "module should export sk");
}
-
+
test.done();
}
};
exports["lang:sl"] = {
setUp : function (cb) {
moment.lang('sl');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/sl'), 'sl', "module should export sl");
}
-
+
test.done();
}
};
exports["lang:sq"] = {
setUp : function (cb) {
moment.lang('sq');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:sr-cyr"] = {
setUp : function (cb) {
moment.lang('sr-cyr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:sr"] = {
setUp : function (cb) {
- moment.lang('sr-lat');
+ moment.lang('sr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:sv"] = {
setUp : function (cb) {
moment.lang('sv');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/sv'), 'sv', "module should export sv");
}
-
+
test.done();
}
};
exports["lang:ta"] = {
setUp : function (cb) {
moment.lang('ta');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
"format" : function (test) {
test.expect(22);
var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'ஞாயிற்றுக்கிழமை, பிப்ரவரி 14வது 2010, 3:25:50 எற்பாடு'],
- ['ddd, hA', 'ஞாயிறு, 3 எற்பாடு'],
- ['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', '8 8வது 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', ' எற்பாடு எற்பாடு'],
- ['[ஆண்டின்] DDDo [நாள்]', 'ஆண்டின் 45வது நாள்'],
- ['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 எற்பாடு'],
+ ['ddd, hA', 'ஞாயிறு, 3 எற்பாடு'],
+ ['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', '8 8வது 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', ' எற்பாடு எற்பாடு'],
+ ['[ஆண்டின்] DDDo [நாள்]', 'ஆண்டின் 45வது நாள்'],
+ ['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;
},
"format month" : function (test) {
- test.expect(12);
+ test.expect(12);
var expected = 'ஜனவரி ஜனவரி_பிப்ரவரி பிப்ரவரி_மார்ச் மார்ச்_ஏப்ரல் ஏப்ரல்_மே மே_ஜூன் ஜூன்_ஜூலை ஜூலை_ஆகஸ்ட் ஆகஸ்ட்_செப்டெம்பர் செப்டெம்பர்_அக்டோபர் அக்டோபர்_நவம்பர் நவம்பர்_டிசம்பர் டிசம்பர்'.split("_"), i;
for (i = 0; i < expected.length; i++) {
test.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]);
exports["lang:th"] = {
setUp : function (cb) {
moment.lang('th');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/th'), 'th', "module should export th");
}
-
+
test.done();
}
};
exports["lang:tl-ph"] = {
setUp : function (cb) {
moment.lang('tl-ph');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:tr"] = {
setUp : function (cb) {
moment.lang('tr');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/tr'), 'tr', "module should export tr");
}
-
+
test.done();
}
};
exports["lang:tzm-la"] = {
setUp : function (cb) {
moment.lang('tzm-la');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/tzm-la'), 'tzm-la', "module should export tzm-la");
}
-
+
test.done();
}
};
exports["lang:tzm"] = {
setUp : function (cb) {
moment.lang('tzm');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:uk"] = {
setUp : function (cb) {
moment.lang('uk');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/uk'), 'uk', "module should export uk");
}
-
+
test.done();
}
};
exports["lang:uz"] = {
setUp : function (cb) {
moment.lang('uz');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/uz'), 'uz', "module should export uz");
}
-
+
test.done();
}
};
exports["lang:vi"] = {
setUp : function (cb) {
moment.lang('vi');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/vi'), 'vi', "module should export vi");
}
-
+
test.done();
}
};
exports["lang:zh-cn"] = {
setUp : function (cb) {
moment.lang('zh-cn');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
exports["lang:zh-tw"] = {
setUp : function (cb) {
moment.lang('zh-tw');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
test.done();
},
-
+
"returns the name of the language" : function (test) {
if (typeof module !== 'undefined' && module.exports) {
test.equal(require('../../lang/zh-tw'), 'zh-tw', "module should export zh-tw");
}
-
+
test.done();
}
};
var moment = require("../../moment");
exports.add = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"add short" : function (test) {
test.expect(12);
};
exports.create = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"array" : function (test) {
test.expect(8);
test.ok(moment([2010]).toDate() instanceof Date, "[2010]");
var moment = require("../../moment");
exports.days_in_month = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"days in month" : function (test) {
test.expect(24);
var months = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i;
}
exports.diff = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"diff" : function (test) {
test.expect(5);
var moment = require("../../moment");
exports.duration = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"object instantiation" : function (test) {
var d = moment.duration({
years: 2,
var moment = require("../../moment");
exports.format = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"format YY" : function (test) {
test.expect(1);
var moment = require("../../moment");
exports.getters_setters = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"getters" : function (test) {
test.expect(8);
var moment = require("../../moment");
exports.invalid = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"invalid" : function (test) {
var m = moment.invalid();
test.equals(m.isValid(), false);
var moment = require("../../moment");
exports.is_after = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"is after without units" : function (test) {
test.expect(17);
var moment = require("../../moment");
exports.is_before = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"is after without units" : function (test) {
test.expect(17);
var moment = require('../../moment');
exports.is_moment = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"is moment object": function (test) {
test.expect(13);
var moment = require("../../moment");
exports.is_same = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"is same without units" : function (test) {
test.expect(17);
var moment = require("../../moment");
exports.is_valid = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"array bad month" : function (test) {
test.expect(2);
test.equal(moment([2010, -1]).isValid(), false, 'month -1 invalid');
var moment = require("../../moment");
exports.lang = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"library getter" : function (test) {
var r;
test.expect(8);
var moment = require("../../moment");
exports.leapyear = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"leap year" : function (test) {
test.expect(4);
exports.listers = {
setUp : function (cb) {
moment.lang('en');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+
cb();
},
exports.min_max = {
setUp : function (cb) {
moment.lang('en');
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
cb();
},
var moment = require("../../moment");
exports.mutable = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"manipulation methods" : function (test) {
var mutableMethods = {
var moment = require("../../moment");
exports.normalizeUnits = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"normalize units" : function (test) {
var fullKeys = ["year", "month", "isoWeek", "week", "day", "hour", "minute", "second", "millisecond", "date", 'dayOfYear', 'weekday', 'isoWeekday', 'weekYear', 'isoWeekYear'],
aliases = ["y", "M", "W", "w", "d", "h", "m", "s", "ms", "D", 'DDD', 'e', 'E', 'gg', 'GG'],
};
exports.parsing_flags = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
'overflow with array' : function (test) {
exports.preparse_postformat = {
setUp: function (cb) {
moment.lang('symbol', symbolLang);
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+
cb();
},
var moment = require("../../moment");
exports.quarter = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"library quarter" : function (test) {
test.expect(7);
var moment = require("../../moment");
exports.end_start_of = {
- setUp : function (cb) {
+ setUp : function (done) {
moment.lang('en');
- cb();
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
},
tearDown : function (cb) {
var moment = require("../../moment");
exports.string_prototype = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"string prototype overrides call" : function (test) {
test.expect(1);
var moment = require("../../moment");
exports.utc = {
- setUp : function (cb) {
+ setUp : function (done) {
moment.lang('en');
- cb();
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+
+ done();
},
tearDown : function (cb) {
var moment = require("../../moment");
exports.week_year = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"iso week year": function (test) {
test.expect(19);
var moment = require("../../moment");
exports.week_year = {
+ setUp : function (done) {
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+ done();
+ },
+
"iso weekday": function (test) {
var i;
test.expect(7 * 7);
var moment = require("../../moment");
exports.weeks = {
- setUp : function (cb) {
+ setUp : function (done) {
moment.lang('en');
- cb();
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+
+ done();
},
tearDown : function (cb) {
var moment = require("../../moment");
exports.zones = {
- setUp : function (cb) {
+ setUp : function (done) {
moment.lang('en');
- cb();
+ moment.createFromInputFallback = function () {
+ throw new Error("input not handled by moment");
+ };
+
+ done();
},
tearDown : function (cb) {