+++ /dev/null
-var fs = require('fs'),
- uglify = require('uglify-js'),
- jshint = require('jshint'),
- gzip = require('gzip'),
- jade = require('jade'),
- clean = require('clean-css'),
- moment = require('./moment');
-
-
-/*********************************************
- Constants
-*********************************************/
-
-
-var JSHINT_CONFIG = {
- "node" : true,
- "es5" : true,
- "browser" : true,
- "boss" : false,
- "curly": true,
- "debug": false,
- "devel": false,
- "eqeqeq": true,
- "eqnull": true,
- "evil": false,
- "forin": false,
- "immed": false,
- "laxbreak": false,
- "newcap": true,
- "noarg": true,
- "noempty": false,
- "nonew": false,
- "nomen": false,
- "onevar": true,
- "plusplus": false,
- "regexp": false,
- "undef": true,
- "sub": true,
- "strict": false,
- "white": true
-};
-var LANG_MINIFY = "ca de en-gb es eu fr gl it kr nb nl pl pt ru sv tr".split(" ");
-var LANG_TEST = "ca de en en-gb es eu fr gl it kr nb nl pl pt ru sv tr".split(" ");
-var LANG_PREFIX = "(function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }";
-var LANG_SUFFIX = "})();";
-var VERSION = '1.4.0';
-var MINIFY_COMMENT = '/* Moment.js | version : ' + VERSION + ' | author : Tim Wood | license : MIT */\n';
-var MINSIZE = 0;
-var SRCSIZE = 0;
-var BUILD_DATE = moment().format('YYMMDD_HHmmss');
-
-var cacheBusting = false;
-
-
-process.argv.forEach(function(val, index, array) {
- switch (val) {
- case 'r':
- cacheBusting = true;
- break;
- default :
- break;
- }
-});
-
-/*********************************************
- Helpers
-*********************************************/
-
-/*
- * function to minify a string and write to a file
- *
- * @param {String} source The source JS
- * @param {String} dest The file destination
- */
-function makeFile(filename, contents, callback) {
- fs.writeFile(filename, contents, 'utf8', function(err) {
- console.log('saved : ' + filename);
- gzip(contents, function(err, data) {
- if (filename === './moment.min.js') {
- console.log(' ------------------------');
- }
- console.log('size : ' + filename + ' ' + contents.length + ' b (' + data.length + ' b)');
- if (filename === './moment.min.js') {
- console.log(' ------------------------');
- }
- });
- if (callback) {
- callback();
- }
- });
-}
-
-/*********************************************
- Uglify
-*********************************************/
-
-/*
- * function to minify a string and write to a file
- *
- * @param {String} source The source JS
- * @param {String} dest The file destination
- */
-function minifyToFile(source, dest, prefix, callback) {
- var ast,
- ugly;
- ast = uglify.parser.parse(source);
- ast = uglify.uglify.ast_mangle(ast);
- ast = uglify.uglify.ast_squeeze(ast);
- ugly = uglify.uglify.gen_code(ast);
-
- makeFile('./' + dest + '.min.js', (prefix || '') + ugly);
-
- if (callback) {
- callback((prefix || '') + ugly);
- }
-}
-
-
-/*********************************************
- JSHint
-*********************************************/
-
-
-function logError(error) {
- console.log('==== ' + error.id + ' ' + error.line + ':' + error.character);
- console.log(' ' + error.reason);
- console.log(' ' + error.evidence);
-}
-
-function hint(source, name) {
- var passed = jshint.JSHINT(source, JSHINT_CONFIG);
-
- if (passed) {
- console.log('jshinted : ' + name);
- return true;
- } else {
- console.log('============================================');
- console.log(name + ' failed jshint ');
- jshint.JSHINT.errors.forEach(logError);
- console.log('============================================');
- return false;
- }
-}
-
-
-/*********************************************
- Lang Minify
-*********************************************/
-
-
-(function(){
- var allSource = '',
- i,
- failures = 0,
- source;
- for (i = 0; i < LANG_MINIFY.length; i++) {
- source = fs.readFileSync('./lang/' + LANG_MINIFY[i] + '.js', 'utf8');
- if (hint(source, 'lang/min/' + LANG_MINIFY[i])) {
- minifyToFile(source, 'lang/min/' + LANG_MINIFY[i]);
- allSource += source;
- } else {
- failures ++;
- }
- }
- if (failures === 0) {
- minifyToFile(allSource, 'lang/min/all');
- minifyToFile(allSource, 'site/js/lang-all');
- }
-})();
-
-
-/*********************************************
- Lang Tests
-*********************************************/
-
-
-(function(){
- var source = LANG_PREFIX;
- for (i = 0; i < LANG_TEST.length; i++) {
- source += fs.readFileSync('./lang/test/' + LANG_TEST[i] + '.js', 'utf8');
- }
- source += LANG_SUFFIX;
- makeFile('./sitesrc/js/lang-tests.js', source, function(){
- makeUnitTests();
- });
-})();
-
-
-/*********************************************
- Main
-*********************************************/
-
-
-(function(){
- var source = fs.readFileSync('./moment.js', 'utf8');
- if (hint(source, 'moment')) {
- minifyToFile(source, 'moment', MINIFY_COMMENT, function(src){
- gzip(src, function(err, data) {
- MINSIZE = data.length;
- makeDocs();
- });
- });
- makeFile('site/js/moment.js', source);
- minifyToFile(source, 'site/js/moment', MINIFY_COMMENT);
- }
- gzip(source, function(err, data) {
- SRCSIZE = source.length;
- makeDocs();
- console.log('size : ./moment.js ' + source.length + ' b (' + data.length + ' b)');
- });
-})();
-
-
-/*********************************************
- JS
-*********************************************/
-
-
-(function(){
- var snippet = fs.readFileSync('./sitesrc/js/snippet.js', 'utf8');
- var docs = fs.readFileSync('./sitesrc/js/docs.js', 'utf8');
- minifyToFile(snippet + docs, 'site/js/docs');
-})();
-
-(function(){
- var moment = fs.readFileSync('./moment.js', 'utf8');
- var fr = fs.readFileSync('./lang/fr.js', 'utf8');
- var snippet = fs.readFileSync('./sitesrc/js/snippet.js', 'utf8');
- var home = fs.readFileSync('./sitesrc/js/home.js', 'utf8');
- minifyToFile(moment + fr + snippet + home, 'site/js/home');
-})();
-
-function makeUnitTests(){
- var q = fs.readFileSync('./sitesrc/js/qunit.js', 'utf8');
- var u = fs.readFileSync('./sitesrc/js/unit-tests.js', 'utf8');
- var l = fs.readFileSync('./sitesrc/js/lang-tests.js', 'utf8');
- makeFile('site/js/test.min.js', q + u + l);
-}
-
-
-/*********************************************
- Jade
-*********************************************/
-
-
-function toKb(input){
- var num = Math.round(input / 100) / 10;
- return num + 'kb';
-}
-
-function jadeToHtml(jadePath, htmlPath) {
- var args = {
- version : VERSION,
- minsize : toKb(MINSIZE),
- srcsize : toKb(SRCSIZE),
- builddate : cacheBusting ? BUILD_DATE : 'nocachebuster'
- };
- var snippet = fs.readFile(jadePath, 'utf8', function(err, data){
- var compile = jade.compile(data, {
- filename : 'sitesrc/html.jade'
- });
- makeFile(htmlPath, compile(args));
- });
-}
-
-function makeDocs() {
- if (SRCSIZE === 0 || MINSIZE === 0) {
- return;
- }
- jadeToHtml('./sitesrc/home.jade', './site/index.html');
- jadeToHtml('./sitesrc/docs.jade', './site/docs/index.html');
- jadeToHtml('./sitesrc/test.jade', './site/test/index.html');
-}
-
-
-/*********************************************
- CSS
-*********************************************/
-
-
-(function(){
- fs.readFile('./sitesrc/css/style.css', 'utf8', function(err, data){
- makeFile('./site/css/style.css', clean.process(data));
- });
-})();
+++ /dev/null
-var bunker = require('bunker');
-var fs = require('fs');
-
-var Open = "(function(){\
- var module = { exports : null },\
- require = function(){ return module.exports; },\
- QUnit = { module : function(){} },\
- ok = function (a, b, c) {\
- if (typeof a == 'function') {\
- a();\
- }\
- if (typeof b == 'function') {\
- b();\
- }\
- if (typeof c == 'function') {\
- c();\
- }\
- },\
- test = ok,\
- deepEqual = ok,\
- equal = ok;";
-var src = fs.readFileSync('./moment.js', 'utf8');
-var srcTest = fs.readFileSync('./site/js/test.min.js', 'utf8');
-var srcTest = fs.readFileSync('./sitesrc/js/unit-tests.js', 'utf8');
-var Close = '})();';
-
-var counts = {};
-var topNode;
-
-var b = bunker(Open + src + srcTest + Close);
-
-function rightPad(input, length) {
- while (input.length < length) {
- input += ' ';
- }
- return input;
-}
-
-/*
- * Bind event listener
- */
-
-b.on('node', function (node) {
- if (!counts[node.id]) {
- counts[node.id] = {
- times : 0,
- node : node
- };
- }
- counts[node.id].times ++;
-});
-
-/*
- * Run the source
- */
-
-b.run();
-
-/*
- * Backfill
- */
-
-b.nodes.forEach(function(node) {
- if (!counts[node.id]) {
- counts[node.id] = {
- times : 0,
- node : node
- };
- }
-});
-
-/*
- * Get the output
- */
-
-console.log('-- Missed Nodes --');
-
-var total = 0;
-var missed = 0;
-
-Object.keys(counts).forEach(function (key) {
- var count = counts[key],
- output = '';
- if (count.times === 0) {
- output += '[';
- output += (count.node.start.line + 1) + ':';
- output += (count.node.start.col) + '] ';
- output = rightPad(output, 15);
- if (count.node.source().length > 100) {
- output += count.node.source().substring(0, 97) + '...';
- } else {
- output += count.node.source();
- }
- console.log(output);
- missed ++;
- }
- total ++;
-});
-
-console.log('-- --');
-if (missed === 0) {
- console.log('YAY! No lines missed!');
-} else {
- console.log('OOPS, you missed ' + missed + ' lines of ' + total + ' (' + (Math.round((missed / total) * 1000) / 10) + '%)');
-}
\ No newline at end of file
past : "%s siden",
s : "få sekunder",
m : "minut",
- mm : "minutter",
+ mm : "%d minutter",
h : "time",
hh : "%d timer",
d : "dag",
+++ /dev/null
-(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demá a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})(),function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)}(),function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)}(),function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)}(),function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)}(),function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:{AM:"오전",am:"오전",PM:"오후",pm:"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)}(),function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===1?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:case 1:case 3:return"[В прошлый] dddd [в] LT";case 6:return"[В прошлое] dddd [в] LT";default:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",dd:"%d дней",M:"месяц",MM:"%d месяцев",y:"год",yy:"%d лет"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",a)}(),function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd [en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}(),function(){var a={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",a)}()
\ No newline at end of file
+++ /dev/null
-
-/**************************************************
- Català
- *************************************************/
-
-module("lang:ca");
-
-test("parse", 96, function() {
- moment.lang('ca');
-
- var tests = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ca');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('ca');
- var expected = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ca');
- var expected = "Diumenge Dg._Dilluns Dl._Dimarts Dt._Dimecres Dc._Dijous Dj._Divendres Dv._Dissabte Ds.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ca');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segons", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuts", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuts", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hores", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hores", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hores", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dies", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dies", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dies", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesos", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesos", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesos", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesos", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesos", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un any", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un any", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anys", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un any", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anys", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ca');
- equal(moment(30000).from(0), "en uns segons", "prefix");
- equal(moment(0).from(30000), "fa uns segons", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('ca');
- equal(moment().fromNow(), "fa uns segons", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('ca');
- equal(moment().add({s:30}).fromNow(), "en uns segons", "en uns segons");
- equal(moment().add({d:5}).fromNow(), "en 5 dies", "en 5 dies");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('ca');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "avui a les 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "avui a les 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "avui a les 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "demá a les 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "demá a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "avui a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ahir a les 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ca');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ca');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ca');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Danish
- *************************************************/
-
-module("lang:da");
-
-test("parse", 96, function() {
- moment.lang('da');
- var tests = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('da');
- var a = [
- ['dddd \\den MMMM Do YYYY, h:mm:ss a', 'Søndag den Februar 14. 2010, 3:25:50 pm'],
- ['ddd hA', 'Søn 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. Søndag Søn'],
- ['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', 'pm PM'],
- ['den DDDo \\d\\ag på året', 'the 45. dag på året'],
- ['L', '14/02/2010'],
- ['LL', '14 Februar 2010'],
- ['LLL', '14 Februar 2010 3:25 PM'],
- ['LLLL', 'Søndag d. 14 Februar 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('da');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('da');
- var expected = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('da');
- var expected = 'Søndag Søn_Mandag Man_Tirsdag Tir_Onsdag Ons_Torsdag Tor_Fredag Fre_Lørdag Lør'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('da');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "få sekunder", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "time", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "time", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dage", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a dage", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dage", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dage", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "månede", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "månede", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "månede", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "månede", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('da');
- equal(moment(30000).from(0), "om få sekunder", "prefix");
- equal(moment(0).from(30000), "for få sekunder siden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('da');
- equal(moment().fromNow(), "for få sekunder siden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('da');
- equal(moment().add({s:30}).fromNow(), "om få sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dage", "in 5 days");
-});
-
+++ /dev/null
-
-/**************************************************
- German
- *************************************************/
-
-module("lang:de");
-
-test("parse", 96, function() {
- moment.lang('de');
- var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('de');
- var a = [
- ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],
- ['ddd, hA', 'So., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. Sonntag So.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14. Februar 2010'],
- ['LLL', '14. Februar 2010 15:25 Uhr'],
- ['LLLL', 'Sonntag, 14. Februar 2010 15:25 Uhr']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('de');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('de');
- var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('de');
- var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('de');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('de');
- equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
- equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('de');
- equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('de');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Heute um 2:00 Uhr", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Heute um 2:25 Uhr", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Heute um 3:00 Uhr", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 2:00 Uhr", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 1:00 Uhr", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 2:00 Uhr", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('de');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('de');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('de');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en-gb");
-
-test("parse", 96, function() {
- moment.lang('en-gb');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en-gb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 February 2010'],
- ['LLL', '14 February 2010 3:25 PM'],
- ['LLLL', 'Sunday, 14 February 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en-gb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en-gb');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en-gb');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en-gb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en-gb');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en-gb');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en-gb');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('en-gb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en-gb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en-gb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en-gb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en");
-
-test("parse", 96, function() {
- moment.lang('en');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '02/14/2010'],
- ['LL', 'February 14 2010'],
- ['LLL', 'February 14 2010 3:25 PM'],
- ['LLLL', 'Sunday, February 14 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('en');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Spanish
- *************************************************/
-
-module("lang:es");
-
-test("parse", 96, function() {
- moment.lang('es');
- var tests = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('es');
- var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('es');
- var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('es');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('es');
- equal(moment(30000).from(0), "en unos segundos", "prefix");
- equal(moment(0).from(30000), "hace unos segundos", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('es');
- equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('es');
- equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('es');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoy a las 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoy a las 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoy a las 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañana a las 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoy a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ayer a las 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('es');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('es');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('es');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Euskara
- *************************************************/
-
-module("lang:eu");
-
-test("parse", 96, function() {
- moment.lang('eu');
- var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('eu');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'ig., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. igandea ig.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '2010ko otsailaren 14a'],
- ['LLL', '2010ko otsailaren 14a 15:25'],
- ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('eu');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('eu');
- var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('eu');
- var expected = 'igandea ig._astelehena al._asteartea ar._asteazkena az._osteguna og._ostirala ol._larunbata lr.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('eu');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundo batzuk", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minutu bat", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minutu bat", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutu", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutu", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "ordu bat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "ordu bat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ordu", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ordu", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ordu", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egun bat", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egun bat", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 egun", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egun bat", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 egun", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 egun", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "hilabete bat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "hilabete bat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "hilabete bat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hilabete", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hilabete", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hilabete", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "hilabete bat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hilabete", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hilabete", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "urte bat", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "urte bat", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 urte", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "urte bat", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 urte", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('eu');
- equal(moment(30000).from(0), "segundo batzuk barru", "prefix");
- equal(moment(0).from(30000), "duela segundo batzuk", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('eu');
- equal(moment().fromNow(), "duela segundo batzuk", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('eu');
- equal(moment().add({s:30}).fromNow(), "segundo batzuk barru", "in seconds");
- equal(moment().add({d:5}).fromNow(), "5 egun barru", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('eu');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "gaur 02:00etan", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "gaur 02:25etan", "now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "gaur 03:00etan", "now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "bihar 02:00etan", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "gaur 01:00etan", "now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "atzo 02:00etan", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('eu');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('eu');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('eu');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- French
- *************************************************/
-
-module("lang:fr");
-
-test("parse", 96, function() {
- moment.lang('fr');
- var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('fr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
- ['ddd, hA', 'dim., 3PM'],
- ['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14ème 14'],
- ['d do dddd ddd', '0 0ème dimanche dim.'],
- ['DDD DDDo DDDD', '45 45ème 045'],
- ['w wo ww', '8 8ème 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 février 2010'],
- ['LLL', '14 février 2010 15:25'],
- ['LLLL', 'dimanche 14 février 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('fr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
- equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
- equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
- equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
- equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
- equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
- equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
- equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
- equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
- equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
- equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
- equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
- equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
- equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
- equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
- equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
- equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
-});
-
-test("format month", 12, function() {
- moment.lang('fr');
- var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('fr');
- var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('fr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('fr');
- equal(moment(30000).from(0), "dans quelques secondes", "prefix");
- equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('fr');
- equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
-});
-
-
-test("same day", 6, function() {
- moment.lang('fr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Ajourd'hui à 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Ajourd'hui à 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Ajourd'hui à 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Ajourd'hui à 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
-});
-
-test("same next week", 15, function() {
- moment.lang('fr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("same last week", 15, function() {
- moment.lang('fr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("same all else", 4, function() {
- moment.lang('fr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Galego
- *************************************************/
-
-module("lang:gl");
-
-test("parse", 96, function() {
- moment.lang('gl');
- var tests = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('gl');
- var expected = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('gl');
- var expected = "Domingo Dom._Luns Lun._Martes Mar._Mércores Mér._Xoves Xov._Venres Ven._Sábado Sáb.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('gl');
- var start = moment([2007, 1, 28]);
-
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segundo", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "unha hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "unha hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('gl');
- equal(moment(30000).from(0), "en uns segundo", "prefix");
- equal(moment(0).from(30000), "fai uns segundo", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('gl');
- equal(moment().fromNow(), "fai uns segundo", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('gl');
- equal(moment().add({s:30}).fromNow(), "en uns segundo", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('gl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoxe ás 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoxe ás 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañá ás 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañá a 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe a 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('gl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('gl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('gl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Italian
- *************************************************/
-
-module("lang:it");
-
-test("parse", 96, function() {
- moment.lang('it');
- var tests = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('it');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, Febbraio 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Febbraio Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domenica Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 Febbraio 2010'],
- ['LLL', '14 Febbraio 2010 15:25'],
- ['LLLL', 'Domenica, 14 Febbraio 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('it');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('it');
- var expected = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('it');
- var expected = 'Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('it');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondi", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuti", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuti", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "un ora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "un ora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ore", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ore", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ore", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un giorno", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un giorno", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 giorni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un giorno", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 giorni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 giorni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mese", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mese", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mese", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesi", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesi", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesi", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mese", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesi", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesi", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un anno", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un anno", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anni", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un anno", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anni", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('it');
- equal(moment(30000).from(0), "in secondi", "prefix");
- equal(moment(0).from(30000), "secondi fa", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('it');
- equal(moment().add({s:30}).fromNow(), "in secondi", "in seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 giorni", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('it');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Oggi alle 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Oggi alle 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Domani alle 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ieri alle 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('it');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('it');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('it');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
+++ /dev/null
-
-/**************************************************
- Korean
- *************************************************/
-
-module("lang:kr");
-
-test("format", 18, function() {
- moment.lang('kr');
- var a = [
- ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
- ['ddd A h', '일 오후 3'],
- ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14일 14'],
- ['d do dddd ddd', '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', '2010.02.14'],
- ['LL', '2010년 2월 14일'],
- ['LLL', '2010년 2월 14일 오후 3시 25분'],
- ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('kr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
- equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
- equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
- equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
- equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
- equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
- equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
- equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
- equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
- equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
- equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
- equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
- equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
- equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
- equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
- equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
- equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
- equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
- equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
- equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
- equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
- equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
- equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
- equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
- equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
- equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
- equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
- equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
-});
-
-test("format month", 12, function() {
- moment.lang('kr');
- var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('kr');
- var expected = '일요일 일_월요일 월_화요일 화_수요일 수_목요일 목_금요일 금_토요일 토'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('kr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
-});
-
-test("suffix", 2, function() {
- moment.lang('kr');
- equal(moment(30000).from(0), "몇초 후", "prefix");
- equal(moment(0).from(30000), "몇초 전", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('kr');
- equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('kr');
- equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('kr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('kr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('kr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('kr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
+++ /dev/null
-
-/**************************************************
- Norwegian bokmål
- *************************************************/
-
-module("lang:nb");
-
-test("parse", 96, function() {
- moment.lang('nb');
- var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'søn, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 februar feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. søndag søn'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februar 2010'],
- ['LLL', '14 februar 2010 15:25'],
- ['LLLL', 'søndag 14 februar 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('nb');
- var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nb');
- var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nb');
- equal(moment(30000).from(0), "om noen sekunder", "prefix");
- equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nb');
- equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nb');
- equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "I dag klokken 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "I dag klokken 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "I dag klokken 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "I morgen klokken 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokken 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokken 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Dutch
- *************************************************/
-
-module("lang:nl");
-
-test("parse", 96, function() {
- moment.lang('nl');
- var tests = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nl');
- var a = [
- ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'],
- ['ddd, HH', 'zo., 15'],
- ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14de 14'],
- ['d do dddd ddd', '0 0de zondag zo.'],
- ['DDD DDDo DDDD', '45 45ste 045'],
- ['w wo ww', '8 8ste 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ste day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'zondag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
- equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');
- equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');
- equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');
- equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');
- equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');
- equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');
- equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');
- equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');
- equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');
- equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');
- equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');
- equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');
- equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');
- equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');
- equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');
- equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');
-});
-
-test("format month", 12, function() {
- moment.lang('nl');
- var expected = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nl');
- var expected = 'zondag zo._maandag ma._dinsdag di._woensdag wo._donderdag do._vrijdag vr._zaterdag za.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "een paar seconden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "één minuut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "één minuut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "één uur", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "één uur", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 uur", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 uur", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 uur", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "één dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "één dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "één dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "één maand", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "één maand", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "één maand", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 maanden", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 maanden", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 maanden", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "één maand", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 maanden", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 maanden", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "één jaar", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "één jaar", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 jaar", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "één jaar", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaar", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nl');
- equal(moment(30000).from(0), "over een paar seconden", "prefix");
- equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nl');
- equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nl');
- equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Vandaag om 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Vandaag om 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Vandaag om 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen om 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Vandaag om 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gisteren om 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Polish
- *************************************************/
-
-module("lang:pl");
-
-test("parse", 96, function() {
- moment.lang('pl');
- var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pl');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'nie, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 luty lut'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. niedziela nie'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 luty 2010'],
- ['LLL', '14 luty 2010 15:25'],
- ['LLLL', 'niedziela, 14 luty 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('pl');
- var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pl');
- var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pl');
- equal(moment(30000).from(0), "za kilka sekund", "prefix");
- equal(moment(0).from(30000), "kilka sekund temu", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('pl');
- equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
-});
-
-
-test("fromNow", 3, function() {
- moment.lang('pl');
- equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
- equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
- equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('pl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Dziś o 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Dziś o 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Dziś o 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Jutro o 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Dziś o 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Portuguese
- *************************************************/
-
-module("lang:pt");
-
-test("parse", 96, function() {
- moment.lang('pt');
- var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pt');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domingo Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 de Fevereiro de 2010'],
- ['LLL', '14 de Fevereiro de 2010 15:25'],
- ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pt');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('pt');
- var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pt');
- var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pt');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pt');
- equal(moment(30000).from(0), "em segundos", "prefix");
- equal(moment(0).from(30000), "segundos atrás", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('pt');
- equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
- equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('pt');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pt');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pt');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- 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");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pt');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- Russian
- *************************************************/
-
-module("lang:ru");
-
-test("parse", 96, function() {
- moment.lang('ru');
- var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('ru');
- 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', '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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-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++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ru');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('ru');
- var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ru');
- var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ru');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минут", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минут", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "часа", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "часа", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часов", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месяц", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месяц", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месяц", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месяц", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месяцев", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "год", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "год", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "год", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 лет", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ru');
- equal(moment(30000).from(0), "через несколько секунд", "prefix");
- equal(moment(0).from(30000), "несколько секунд назад", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('ru');
- equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
- equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('ru');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Сегодня в 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Сегодня в 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Сегодня в 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Завтра в 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Сегодня в 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- return d.day() === 1 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- switch (d.day()) {
- case 0:
- case 1:
- case 3:
- return '[В прошлый] dddd [в] LT';
- case 6:
- return '[В прошлое] dddd [в] LT';
- default:
- return '[В прошлую] dddd [в] LT';
- }
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ru');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
+++ /dev/null
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:sv");
-
-test("parse", 96, function() {
- moment.lang('sv');
- var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('sv');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'söndag, februari 14e 2010, 3:25:50 pm'],
- ['ddd, hA', 'sön, 3PM'],
- ['M Mo MM MMMM MMM', '2 2a 02 februari feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14e 14'],
- ['d do dddd ddd', '0 0e söndag sön'],
- ['DDD DDDo DDDD', '45 45e 045'],
- ['w wo ww', '8 8e 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45e day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'söndag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('sv');
- equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
- equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');
- equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e');
- equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e');
- equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e');
- equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e');
- equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e');
- equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e');
- equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e');
- equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e');
- equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e');
- equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e');
- equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e');
- equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e');
- equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e');
- equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e');
- equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e');
- equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e');
- equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');
- equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');
- equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e');
- equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e');
- equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e');
- equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e');
- equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e');
- equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e');
- equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e');
- equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');
-});
-
-test("format month", 12, function() {
- moment.lang('sv');
- var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('sv');
- var expected = 'söndag sön_måndag mån_tisdag tis_onsdag ons_torsdag tor_fredag fre_lördag lör'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('sv');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "några sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "en minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "en minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en timme", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en timme", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timmar", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timmar", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timmar", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagar", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagar", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagar", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en månad", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en månad", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en månad", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 månader", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 månader", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 månader", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en månad", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 månader", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 månader", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('sv');
- equal(moment(30000).from(0), "om några sekunder", "prefix");
- equal(moment(0).from(30000), "för några sekunder sen", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('sv');
- equal(moment().fromNow(), "för några sekunder sen", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('sv');
- equal(moment().add({s:30}).fromNow(), "om några sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('sv');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Idag klockan 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Idag klockan 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Idag klockan 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Imorgon klockan 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Idag klockan 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Igår klockan 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('sv');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('sv');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('sv');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
\ No newline at end of file
+++ /dev/null
-
-/**************************************************
- Turkish
- *************************************************/
-
-module("lang:tr");
-
-test("parse", 96, function() {
- moment.lang('tr');
- var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('tr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Pazar, Şubat 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Paz, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 Şubat Şub'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Pazar Paz'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14 Şubat 2010'],
- ['LLL', '14 Şubat 2010 15:25'],
- ['LLLL', 'Pazar, 14 Şubat 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('tr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('tr');
- var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('tr');
- var expected = 'Pazar Paz_Pazartesi Pts_Salı Sal_Çarşamba Çar_Perşembe Per_Cuma Cum_Cumartesi Cts'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('tr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "birkaç saniye", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "bir dakika", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "bir dakika", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 dakika", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 dakika", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "bir saat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "bir saat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 saat", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 saat", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 saat", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "bir gün", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "bir gün", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 gün", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "bir gün", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 gün", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 gün", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "bir ay", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "bir ay", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "bir ay", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 ay", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 ay", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 ay", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "bir ay", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 ay", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 ay", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "bir yıl", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "bir yıl", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 yıl", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "bir yıl", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 yıl", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('tr');
- equal(moment(30000).from(0), "birkaç saniye sonra", "prefix");
- equal(moment(0).from(30000), "birkaç saniye önce", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('tr');
- equal(moment().fromNow(), "birkaç saniye önce", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('tr');
- equal(moment().add({s:30}).fromNow(), "birkaç saniye sonra", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5 gün sonra", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('tr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "bugün saat 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "bugün saat 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "bugün saat 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "yarın saat 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "bugün saat 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "dün 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('tr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('tr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('tr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
--- /dev/null
+LANG_ALL = lang/*.js
+TEST_ALL = test/prefix/prefix.js test/non-lang-tests.js test/lang/*.js test/prefix/suffix.js
+
+all: langs moment
+
+moment:
+ uglifyjs -o min/moment.min.js moment.js
+
+langs: langtests
+ cat $(LANG_ALL) | uglifyjs -o min/lang-all.min.js
+ find lang -name "*.js" -exec uglifyjs -o min/'{}' '{}' \;
+
+langtests:
+ cat $(TEST_ALL) > test/all-tests.js
+
+size: moment langs
+# FILESIZE FOR ALL LANGS
+ cp min/lang-all.min.js min/lang-all.min.gzip.js
+ gzip min/lang-all.min.gzip.js
+ gzip -l min/lang-all.min.gzip.js.gz
+ rm min/lang-all.min.gzip.js.gz
+# FILESIZE FOR LIBRARY
+ cp min/moment.min.js min/moment.min.gzip.js
+ gzip min/moment.min.gzip.js
+ gzip -l min/moment.min.gzip.js.gz
+ rm min/moment.min.gzip.js.gz
+
+test: moment
+ nodeunit ./test/non-lang ./test/lang
+
+testmoment: moment
+ nodeunit ./test/non-lang
+
+testlang:
+ nodeunit ./test/lang
\ No newline at end of file
--- /dev/null
+(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demá a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})(),function(){var a={months:"Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),weekdays:"Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),weekdaysShort:"Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd D. MMMM, YYYY h:mm A"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"minut",mm:"minutter",h:"time",hh:"%d timer",d:"dag",dd:"%d dage",M:"månede",MM:"%d måneder",y:"år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("da",a)}(),function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)}(),function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)}(),function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)}(),function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)}(),function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:{AM:"오전",am:"오전",PM:"오후",pm:"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)}(),function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===1?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:case 1:case 3:return"[В прошлый] dddd [в] LT";case 6:return"[В прошлое] dddd [в] LT";default:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",dd:"%d дней",M:"месяц",MM:"%d месяцев",y:"год",yy:"%d лет"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",a)}(),function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd [en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}(),function(){var a={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",a)}();
\ No newline at end of file
-(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demá a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})()
\ No newline at end of file
+(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demá a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})();
\ No newline at end of file
--- /dev/null
+(function(){var a={months:"Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),weekdays:"Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),weekdaysShort:"Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),longDateFormat:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd D. MMMM, YYYY h:mm A"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"minut",mm:"minutter",h:"time",hh:"%d timer",d:"dag",dd:"%d dage",M:"månede",MM:"%d måneder",y:"år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("da",a)})();
\ No newline at end of file
-(function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)})()
\ No newline at end of file
+(function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)})();
\ No newline at end of file
-(function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)})()
\ No newline at end of file
+(function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)})();
\ No newline at end of file
-(function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)})()
\ No newline at end of file
+(function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)})();
\ No newline at end of file
-(function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)})()
\ No newline at end of file
+(function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)})();
\ No newline at end of file
-(function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})()
\ No newline at end of file
+(function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)})();
\ No newline at end of file
-(function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)})()
\ No newline at end of file
+(function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)})();
\ No newline at end of file
-(function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)})()
\ No newline at end of file
+(function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)})();
\ No newline at end of file
-(function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:{AM:"오전",am:"오전",PM:"오후",pm:"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)})()
\ No newline at end of file
+(function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:{AM:"오전",am:"오전",PM:"오후",pm:"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)})();
\ No newline at end of file
-(function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)})()
\ No newline at end of file
+(function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)})();
\ No newline at end of file
-(function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)})()
\ No newline at end of file
+(function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)})();
\ No newline at end of file
-(function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)})()
\ No newline at end of file
+(function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)})();
\ No newline at end of file
-(function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)})()
\ No newline at end of file
+(function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)})();
\ No newline at end of file
-(function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===1?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:case 1:case 3:return"[В прошлый] dddd [в] LT";case 6:return"[В прошлое] dddd [в] LT";default:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",dd:"%d дней",M:"месяц",MM:"%d месяцев",y:"год",yy:"%d лет"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",a)})()
\ No newline at end of file
+(function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===1?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:case 1:case 3:return"[В прошлый] dddd [в] LT";case 6:return"[В прошлое] dddd [в] LT";default:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",dd:"%d дней",M:"месяц",MM:"%d месяцев",y:"год",yy:"%d лет"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",a)})();
\ No newline at end of file
-(function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd [en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)})()
\ No newline at end of file
+(function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd [en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)})();
\ No newline at end of file
-(function(){var a={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",a)})()
\ No newline at end of file
+(function(){var a={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",a)})();
\ No newline at end of file
-/* Moment.js | version : 1.4.0 | author : Tim Wood | license : MIT */
-(function(a,b){function r(a){this._d=a}function s(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function t(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j,k;return f&&e&&(g[c]=+e),h=(g.ms||g.milliseconds||0)+(g.s||g.seconds||0)*1e3+(g.m||g.minutes||0)*6e4+(g.h||g.hours||0)*36e5,i=(g.d||g.days||0)+(g.w||g.weeks||0)*7,j=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&b.setDate(b.getDate()+i*d),j&&(k=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+j*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),k))),b}function u(a){return Object.prototype.toString.call(a)==="[object Array]"}function v(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function w(b,d){function u(d){var e,j;switch(d){case"M":return f+1;case"Mo":return f+1+q(f+1);case"MM":return s(f+1,2);case"MMM":return c.monthsShort[f];case"MMMM":return c.months[f];case"D":return g;case"Do":return g+q(g);case"DD":return s(g,2);case"DDD":return e=new a(h,f,g),j=new a(h,0,1),~~((e-j)/864e5+1.5);case"DDDo":return e=u("DDD"),e+q(e);case"DDDD":return s(u("DDD"),3);case"d":return i;case"do":return i+q(i);case"ddd":return c.weekdaysShort[i];case"dddd":return c.weekdays[i];case"w":return e=new a(h,f,g-i+5),j=new a(e.getFullYear(),0,4),~~((e-j)/864e5/7+1.5);case"wo":return e=u("w"),e+q(e);case"ww":return s(u("w"),2);case"YY":return s(h%100,2);case"YYYY":return h;case"a":return m>11?t.pm:t.am;case"A":return m>11?t.PM:t.AM;case"H":return m;case"HH":return s(m,2);case"h":return m%12||12;case"hh":return s(m%12||12,2);case"m":return n;case"mm":return s(n,2);case"s":return o;case"ss":return s(o,2);case"zz":case"z":return(b.toString().match(l)||[""])[0].replace(k,"");case"Z":return(p>0?"+":"-")+s(~~(Math.abs(p)/60),2)+":"+s(~~(Math.abs(p)%60),2);case"ZZ":return(p>0?"+":"-")+s(~~(10*Math.abs(p)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return w(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=new r(b),f=e.month(),g=e.date(),h=e.year(),i=e.day(),m=e.hours(),n=e.minutes(),o=e.seconds(),p=-e.zone(),q=c.ordinal,t=c.meridiem;return d.replace(j,u)}function x(b,d){function p(a,b){var d;switch(a){case"M":case"MM":e[1]=~~b-1;break;case"MMM":case"MMMM":for(d=0;d<12;d++)if(c.monthsParse[d].test(b)){e[1]=d;break}break;case"D":case"DD":case"DDD":case"DDDD":e[2]=~~b;break;case"YY":b=~~b,e[0]=b+(b>70?1900:2e3);break;case"YYYY":e[0]=~~Math.abs(b);break;case"a":case"A":l=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"Z":case"ZZ":h=!0,d=(b||"").match(o),d&&d[1]&&(f=~~d[1]),d&&d[2]&&(g=~~d[2]),d&&d[0]==="+"&&(f=-f,g=-g)}}var e=[0,0,1,0,0,0,0],f=0,g=0,h=!1,i=b.match(n),j=d.match(m),k,l;for(k=0;k<j.length;k++)p(j[k],i[k]);return l&&e[3]<12&&(e[3]+=12),l===!1&&e[3]===12&&(e[3]=0),e[3]+=f,e[4]+=g,h?new a(a.UTC.apply({},e)):v(e)}function y(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function z(a,b){var c,d=a.match(n),e=[],f=99,g,h,i;for(g=0;g<b.length;g++)h=x(a,b[g]),i=y(d,w(h,b[g]).match(n)),i<f&&(f=i,c=h);return c}function A(a,b,d){var e=c.relativeTime[a];return typeof e=="function"?e(b||1,!!d,a):e.replace(/%d/i,b||1)}function B(a,b){var c=d(Math.abs(a)/1e3),e=d(c/60),f=d(e/60),g=d(f/24),h=d(g/365),i=c<45&&["s",c]||e===1&&["m"]||e<45&&["mm",e]||f===1&&["h"]||f<22&&["hh",f]||g===1&&["d"]||g<=25&&["dd",g]||g<=45&&["M"]||g<345&&["MM",d(g/30)]||h===1&&["y"]||["yy",h];return i[2]=b,A.apply({},i)}function C(a,b){c.fn[a]=function(a){return a!=null?(this._d["set"+b](a),this):this._d["get"+b]()}}var c,d=Math.round,e={},f=typeof module!="undefined",g="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),h,i=/^\/?Date\((\d+)/i,j=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,k=/[^A-Z]/g,l=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,m=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,n=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,o=/([\+\-]|\d\d)/gi,p="1.4.0",q="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|");c=function(c,d){if(c===null)return null;var e,f;return c&&c._d instanceof a?e=new a(+c._d):d?u(d)?e=z(c,d):e=x(c,d):(f=i.exec(c),e=c===b?new a:f?new a(+f[1]):c instanceof a?c:u(c)?v(c):new a(c)),new r(e)},c.version=p,c.lang=function(a,b){var d,h,i,j=[];if(b){for(d=0;d<12;d++)j[d]=new RegExp("^"+b.months[d]+"|^"+b.monthsShort[d].replace(".",""),"i");b.monthsParse=b.monthsParse||j,e[a]=b}if(e[a])for(d=0;d<g.length;d++)h=g[d],c[h]=e[a][h]||c[h];else f&&(i=require("./lang/"+a),c.lang(a,i))},c.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=r.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},"native":function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return w(this._d,a)},add:function(a,b){return this._d=t(this._d,a,1,b),this},subtract:function(a,b){return this._d=t(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+j/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=B(d,b);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=c.calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<c([this.year()]).zone()||this.zone()<c([this.year(),5]).zone()},day:function(a){var b=this._d.getDay();return a==null?b:this.add({d:a-b})},sod:function(){return this.clone().hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})}};for(h=0;h<q.length;h++)C(q[h].toLowerCase(),q[h]);C("year","FullYear"),c.fn.zone=function(){return this._d.getTimezoneOffset()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c),typeof define=="function"&&define.amd&&define("moment",[],function(){return c})})(Date)
\ No newline at end of file
+// moment.js
+// version : 1.4.0
+// author : Tim Wood
+// license : MIT
+// momentjs.com
+(function(a,b){function r(a){this._d=a}function s(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function t(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j,k;return f&&e&&(g[c]=+e),h=(g.ms||g.milliseconds||0)+(g.s||g.seconds||0)*1e3+(g.m||g.minutes||0)*6e4+(g.h||g.hours||0)*36e5,i=(g.d||g.days||0)+(g.w||g.weeks||0)*7,j=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&b.setDate(b.getDate()+i*d),j&&(k=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+j*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),k))),b}function u(a){return Object.prototype.toString.call(a)==="[object Array]"}function v(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function w(b,d){function u(d){var e,j;switch(d){case"M":return f+1;case"Mo":return f+1+q(f+1);case"MM":return s(f+1,2);case"MMM":return c.monthsShort[f];case"MMMM":return c.months[f];case"D":return g;case"Do":return g+q(g);case"DD":return s(g,2);case"DDD":return e=new a(h,f,g),j=new a(h,0,1),~~((e-j)/864e5+1.5);case"DDDo":return e=u("DDD"),e+q(e);case"DDDD":return s(u("DDD"),3);case"d":return i;case"do":return i+q(i);case"ddd":return c.weekdaysShort[i];case"dddd":return c.weekdays[i];case"w":return e=new a(h,f,g-i+5),j=new a(e.getFullYear(),0,4),~~((e-j)/864e5/7+1.5);case"wo":return e=u("w"),e+q(e);case"ww":return s(u("w"),2);case"YY":return s(h%100,2);case"YYYY":return h;case"a":return m>11?t.pm:t.am;case"A":return m>11?t.PM:t.AM;case"H":return m;case"HH":return s(m,2);case"h":return m%12||12;case"hh":return s(m%12||12,2);case"m":return n;case"mm":return s(n,2);case"s":return o;case"ss":return s(o,2);case"zz":case"z":return(b.toString().match(l)||[""])[0].replace(k,"");case"Z":return(p>0?"+":"-")+s(~~(Math.abs(p)/60),2)+":"+s(~~(Math.abs(p)%60),2);case"ZZ":return(p>0?"+":"-")+s(~~(10*Math.abs(p)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return w(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=new r(b),f=e.month(),g=e.date(),h=e.year(),i=e.day(),m=e.hours(),n=e.minutes(),o=e.seconds(),p=-e.zone(),q=c.ordinal,t=c.meridiem;return d.replace(j,u)}function x(b,d){function p(a,b){var d;switch(a){case"M":case"MM":e[1]=~~b-1;break;case"MMM":case"MMMM":for(d=0;d<12;d++)if(c.monthsParse[d].test(b)){e[1]=d;break}break;case"D":case"DD":case"DDD":case"DDDD":e[2]=~~b;break;case"YY":b=~~b,e[0]=b+(b>70?1900:2e3);break;case"YYYY":e[0]=~~Math.abs(b);break;case"a":case"A":l=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"Z":case"ZZ":h=!0,d=(b||"").match(o),d&&d[1]&&(f=~~d[1]),d&&d[2]&&(g=~~d[2]),d&&d[0]==="+"&&(f=-f,g=-g)}}var e=[0,0,1,0,0,0,0],f=0,g=0,h=!1,i=b.match(n),j=d.match(m),k,l;for(k=0;k<j.length;k++)p(j[k],i[k]);return l&&e[3]<12&&(e[3]+=12),l===!1&&e[3]===12&&(e[3]=0),e[3]+=f,e[4]+=g,h?new a(a.UTC.apply({},e)):v(e)}function y(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function z(a,b){var c,d=a.match(n),e=[],f=99,g,h,i;for(g=0;g<b.length;g++)h=x(a,b[g]),i=y(d,w(h,b[g]).match(n)),i<f&&(f=i,c=h);return c}function A(a,b,d){var e=c.relativeTime[a];return typeof e=="function"?e(b||1,!!d,a):e.replace(/%d/i,b||1)}function B(a,b){var c=d(Math.abs(a)/1e3),e=d(c/60),f=d(e/60),g=d(f/24),h=d(g/365),i=c<45&&["s",c]||e===1&&["m"]||e<45&&["mm",e]||f===1&&["h"]||f<22&&["hh",f]||g===1&&["d"]||g<=25&&["dd",g]||g<=45&&["M"]||g<345&&["MM",d(g/30)]||h===1&&["y"]||["yy",h];return i[2]=b,A.apply({},i)}function C(a,b){c.fn[a]=function(a){return a!=null?(this._d["set"+b](a),this):this._d["get"+b]()}}var c,d=Math.round,e={},f=typeof module!="undefined",g="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),h,i=/^\/?Date\((\d+)/i,j=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,k=/[^A-Z]/g,l=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,m=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,n=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,o=/([\+\-]|\d\d)/gi,p="1.4.0",q="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|");c=function(c,d){if(c===null)return null;var e,f;return c&&c._d instanceof a?e=new a(+c._d):d?u(d)?e=z(c,d):e=x(c,d):(f=i.exec(c),e=c===b?new a:f?new a(+f[1]):c instanceof a?c:u(c)?v(c):new a(c)),new r(e)},c.version=p,c.lang=function(a,b){var d,h,i,j=[];if(b){for(d=0;d<12;d++)j[d]=new RegExp("^"+b.months[d]+"|^"+b.monthsShort[d].replace(".",""),"i");b.monthsParse=b.monthsParse||j,e[a]=b}if(e[a])for(d=0;d<g.length;d++)h=g[d],c[h]=e[a][h]||c[h];else f&&(i=require("./lang/"+a),c.lang(a,i))},c.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=r.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},"native":function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return w(this._d,a)},add:function(a,b){return this._d=t(this._d,a,1,b),this},subtract:function(a,b){return this._d=t(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+j/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=B(d,b);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=c.calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<c([this.year()]).zone()||this.zone()<c([this.year(),5]).zone()},day:function(a){var b=this._d.getDay();return a==null?b:this.add({d:a-b})},sod:function(){return this.clone().hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})}};for(h=0;h<q.length;h++)C(q[h].toLowerCase(),q[h]);C("year","FullYear"),c.fn.zone=function(){return this._d.getTimezoneOffset()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c),typeof define=="function"&&define.amd&&define("moment",[],function(){return c})})(Date);
\ No newline at end of file
--- /dev/null
+// moment.js
+// version : 1.4.0
+// author : Tim Wood
+// license : MIT
+// momentjs.com
+(function(a, b) {
+ function r(a) {
+ this._d = a;
+ }
+ function s(a, b) {
+ var c = a + "";
+ while (c.length < b) c = "0" + c;
+ return c;
+ }
+ function t(b, c, d, e) {
+ var f = typeof c == "string", g = f ? {} : c, h, i, j, k;
+ return f && e && (g[c] = +e), h = (g.ms || g.milliseconds || 0) + (g.s || g.seconds || 0) * 1e3 + (g.m || g.minutes || 0) * 6e4 + (g.h || g.hours || 0) * 36e5, i = (g.d || g.days || 0) + (g.w || g.weeks || 0) * 7, j = (g.M || g.months || 0) + (g.y || g.years || 0) * 12, h && b.setTime(+b + h * d), i && b.setDate(b.getDate() + i * d), j && (k = b.getDate(), b.setDate(1), b.setMonth(b.getMonth() + j * d), b.setDate(Math.min((new a(b.getFullYear(), b.getMonth() + 1, 0)).getDate(), k))), b;
+ }
+ function u(a) {
+ return Object.prototype.toString.call(a) === "[object Array]";
+ }
+ function v(b) {
+ return new a(b[0], b[1] || 0, b[2] || 1, b[3] || 0, b[4] || 0, b[5] || 0, b[6] || 0);
+ }
+ function w(b, d) {
+ function u(d) {
+ var e, j;
+ switch (d) {
+ case "M":
+ return f + 1;
+ case "Mo":
+ return f + 1 + q(f + 1);
+ case "MM":
+ return s(f + 1, 2);
+ case "MMM":
+ return c.monthsShort[f];
+ case "MMMM":
+ return c.months[f];
+ case "D":
+ return g;
+ case "Do":
+ return g + q(g);
+ case "DD":
+ return s(g, 2);
+ case "DDD":
+ return e = new a(h, f, g), j = new a(h, 0, 1), ~~((e - j) / 864e5 + 1.5);
+ case "DDDo":
+ return e = u("DDD"), e + q(e);
+ case "DDDD":
+ return s(u("DDD"), 3);
+ case "d":
+ return i;
+ case "do":
+ return i + q(i);
+ case "ddd":
+ return c.weekdaysShort[i];
+ case "dddd":
+ return c.weekdays[i];
+ case "w":
+ return e = new a(h, f, g - i + 5), j = new a(e.getFullYear(), 0, 4), ~~((e - j) / 864e5 / 7 + 1.5);
+ case "wo":
+ return e = u("w"), e + q(e);
+ case "ww":
+ return s(u("w"), 2);
+ case "YY":
+ return s(h % 100, 2);
+ case "YYYY":
+ return h;
+ case "a":
+ return m > 11 ? t.pm : t.am;
+ case "A":
+ return m > 11 ? t.PM : t.AM;
+ case "H":
+ return m;
+ case "HH":
+ return s(m, 2);
+ case "h":
+ return m % 12 || 12;
+ case "hh":
+ return s(m % 12 || 12, 2);
+ case "m":
+ return n;
+ case "mm":
+ return s(n, 2);
+ case "s":
+ return o;
+ case "ss":
+ return s(o, 2);
+ case "zz":
+ case "z":
+ return (b.toString().match(l) || [ "" ])[0].replace(k, "");
+ case "Z":
+ return (p > 0 ? "+" : "-") + s(~~(Math.abs(p) / 60), 2) + ":" + s(~~(Math.abs(p) % 60), 2);
+ case "ZZ":
+ return (p > 0 ? "+" : "-") + s(~~(10 * Math.abs(p) / 6), 4);
+ case "L":
+ case "LL":
+ case "LLL":
+ case "LLLL":
+ case "LT":
+ return w(b, c.longDateFormat[d]);
+ default:
+ return d.replace(/(^\[)|(\\)|\]$/g, "");
+ }
+ }
+ var e = new r(b), f = e.month(), g = e.date(), h = e.year(), i = e.day(), m = e.hours(), n = e.minutes(), o = e.seconds(), p = -e.zone(), q = c.ordinal, t = c.meridiem;
+ return d.replace(j, u);
+ }
+ function x(b, d) {
+ function p(a, b) {
+ var d;
+ switch (a) {
+ case "M":
+ case "MM":
+ e[1] = ~~b - 1;
+ break;
+ case "MMM":
+ case "MMMM":
+ for (d = 0; d < 12; d++) if (c.monthsParse[d].test(b)) {
+ e[1] = d;
+ break;
+ }
+ break;
+ case "D":
+ case "DD":
+ case "DDD":
+ case "DDDD":
+ e[2] = ~~b;
+ break;
+ case "YY":
+ b = ~~b, e[0] = b + (b > 70 ? 1900 : 2e3);
+ break;
+ case "YYYY":
+ e[0] = ~~Math.abs(b);
+ break;
+ case "a":
+ case "A":
+ l = b.toLowerCase() === "pm";
+ break;
+ case "H":
+ case "HH":
+ case "h":
+ case "hh":
+ e[3] = ~~b;
+ break;
+ case "m":
+ case "mm":
+ e[4] = ~~b;
+ break;
+ case "s":
+ case "ss":
+ e[5] = ~~b;
+ break;
+ case "Z":
+ case "ZZ":
+ h = !0, d = (b || "").match(o), d && d[1] && (f = ~~d[1]), d && d[2] && (g = ~~d[2]), d && d[0] === "+" && (f = -f, g = -g);
+ }
+ }
+ var e = [ 0, 0, 1, 0, 0, 0, 0 ], f = 0, g = 0, h = !1, i = b.match(n), j = d.match(m), k, l;
+ for (k = 0; k < j.length; k++) p(j[k], i[k]);
+ return l && e[3] < 12 && (e[3] += 12), l === !1 && e[3] === 12 && (e[3] = 0), e[3] += f, e[4] += g, h ? new a(a.UTC.apply({}, e)) : v(e);
+ }
+ function y(a, b) {
+ var c = Math.min(a.length, b.length), d = Math.abs(a.length - b.length), e = 0, f;
+ for (f = 0; f < c; f++) ~~a[f] !== ~~b[f] && e++;
+ return e + d;
+ }
+ function z(a, b) {
+ var c, d = a.match(n), e = [], f = 99, g, h, i;
+ for (g = 0; g < b.length; g++) h = x(a, b[g]), i = y(d, w(h, b[g]).match(n)), i < f && (f = i, c = h);
+ return c;
+ }
+ function A(a, b, d) {
+ var e = c.relativeTime[a];
+ return typeof e == "function" ? e(b || 1, !!d, a) : e.replace(/%d/i, b || 1);
+ }
+ function B(a, b) {
+ var c = d(Math.abs(a) / 1e3), e = d(c / 60), f = d(e / 60), g = d(f / 24), h = d(g / 365), i = c < 45 && [ "s", c ] || e === 1 && [ "m" ] || e < 45 && [ "mm", e ] || f === 1 && [ "h" ] || f < 22 && [ "hh", f ] || g === 1 && [ "d" ] || g <= 25 && [ "dd", g ] || g <= 45 && [ "M" ] || g < 345 && [ "MM", d(g / 30) ] || h === 1 && [ "y" ] || [ "yy", h ];
+ return i[2] = b, A.apply({}, i);
+ }
+ function C(a, b) {
+ c.fn[a] = function(a) {
+ return a != null ? (this._d["set" + b](a), this) : this._d["get" + b]();
+ };
+ }
+ var c, d = Math.round, e = {}, f = typeof module != "undefined", g = "months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"), h, i = /^\/?Date\((\d+)/i, j = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g, k = /[^A-Z]/g, l = /\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g, m = /(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g, n = /(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi, o = /([\+\-]|\d\d)/gi, p = "1.4.0", q = "Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|");
+ c = function(c, d) {
+ if (c === null) return null;
+ var e, f;
+ return c && c._d instanceof a ? e = new a(+c._d) : d ? u(d) ? e = z(c, d) : e = x(c, d) : (f = i.exec(c), e = c === b ? new a : f ? new a(+f[1]) : c instanceof a ? c : u(c) ? v(c) : new a(c)), new r(e);
+ }, c.version = p, c.lang = function(a, b) {
+ var d, h, i, j = [];
+ if (b) {
+ for (d = 0; d < 12; d++) j[d] = new RegExp("^" + b.months[d] + "|^" + b.monthsShort[d].replace(".", ""), "i");
+ b.monthsParse = b.monthsParse || j, e[a] = b;
+ }
+ if (e[a]) for (d = 0; d < g.length; d++) h = g[d], c[h] = e[a][h] || c[h]; else f && (i = require("./lang/" + a), c.lang(a, i));
+ }, c.lang("en", {
+ months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
+ monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
+ weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
+ weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
+ longDateFormat: {
+ LT: "h:mm A",
+ L: "MM/DD/YYYY",
+ LL: "MMMM D YYYY",
+ LLL: "MMMM D YYYY LT",
+ LLLL: "dddd, MMMM D YYYY LT"
+ },
+ meridiem: {
+ AM: "AM",
+ am: "am",
+ PM: "PM",
+ pm: "pm"
+ },
+ calendar: {
+ sameDay: "[Today at] LT",
+ nextDay: "[Tomorrow at] LT",
+ nextWeek: "dddd [at] LT",
+ lastDay: "[Yesterday at] LT",
+ lastWeek: "[last] dddd [at] LT",
+ sameElse: "L"
+ },
+ relativeTime: {
+ future: "in %s",
+ past: "%s ago",
+ s: "a few seconds",
+ m: "a minute",
+ mm: "%d minutes",
+ h: "an hour",
+ hh: "%d hours",
+ d: "a day",
+ dd: "%d days",
+ M: "a month",
+ MM: "%d months",
+ y: "a year",
+ yy: "%d years"
+ },
+ ordinal: function(a) {
+ var b = a % 10;
+ return ~~(a % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
+ }
+ }), c.fn = r.prototype = {
+ clone: function() {
+ return c(this);
+ },
+ valueOf: function() {
+ return +this._d;
+ },
+ "native": function() {
+ return this._d;
+ },
+ toString: function() {
+ return this._d.toString();
+ },
+ toDate: function() {
+ return this._d;
+ },
+ format: function(a) {
+ return w(this._d, a);
+ },
+ add: function(a, b) {
+ return this._d = t(this._d, a, 1, b), this;
+ },
+ subtract: function(a, b) {
+ return this._d = t(this._d, a, -1, b), this;
+ },
+ diff: function(a, b, e) {
+ var f = c(a), g = (this.zone() - f.zone()) * 6e4, h = this._d - f._d - g, i = this.year() - f.year(), j = this.month() - f.month(), k = this.date() - f.date(), l;
+ return b === "months" ? l = i * 12 + j + k / 30 : b === "years" ? l = i + j / 12 : l = b === "seconds" ? h / 1e3 : b === "minutes" ? h / 6e4 : b === "hours" ? h / 36e5 : b === "days" ? h / 864e5 : b === "weeks" ? h / 6048e5 : h, e ? l : d(l);
+ },
+ from: function(a, b) {
+ var d = this.diff(a), e = c.relativeTime, f = B(d, b);
+ return b ? f : (d <= 0 ? e.past : e.future).replace(/%s/i, f);
+ },
+ fromNow: function(a) {
+ return this.from(c(), a);
+ },
+ calendar: function() {
+ var a = this.diff(c().sod(), "days", !0), b = c.calendar, d = b.sameElse, e = a < -6 ? d : a < -1 ? b.lastWeek : a < 0 ? b.lastDay : a < 1 ? b.sameDay : a < 2 ? b.nextDay : a < 7 ? b.nextWeek : d;
+ return this.format(typeof e == "function" ? e.apply(this) : e);
+ },
+ isLeapYear: function() {
+ var a = this.year();
+ return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0;
+ },
+ isDST: function() {
+ return this.zone() < c([ this.year() ]).zone() || this.zone() < c([ this.year(), 5 ]).zone();
+ },
+ day: function(a) {
+ var b = this._d.getDay();
+ return a == null ? b : this.add({
+ d: a - b
+ });
+ },
+ sod: function() {
+ return this.clone().hours(0).minutes(0).seconds(0).milliseconds(0);
+ },
+ eod: function() {
+ return this.sod().add({
+ d: 1,
+ ms: -1
+ });
+ }
+ };
+ for (h = 0; h < q.length; h++) C(q[h].toLowerCase(), q[h]);
+ C("year", "FullYear"), c.fn.zone = function() {
+ return this._d.getTimezoneOffset();
+ }, f && (module.exports = c), typeof window != "undefined" && (window.moment = c), typeof define == "function" && define.amd && define("moment", [], function() {
+ return c;
+ });
+})(Date);
\ No newline at end of file
-// Moment.js
-//
-// (c) 2011 Tim Wood
-// Moment.js is freely distributable under the terms of the MIT license.
-//
-// Version 1.4.0
-
-/*global define:false */
+// moment.js
+// version : 1.4.0
+// author : Tim Wood
+// license : MIT
+// momentjs.com
(function (Date, undefined) {
+++ /dev/null
-# Apache configuration file
-# httpd.apache.org/docs/2.2/mod/quickreference.html
-
-# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
-# httpd.apache.org/docs/2.2/howto/htaccess.html
-
-# Techniques in here adapted from all over, including:
-# Kroc Camen: camendesign.com/.htaccess
-# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
-# Sample .htaccess file of CMS MODx: modxcms.com
-
-
-###
-### If you run a webserver other than apache, consider:
-### github.com/paulirish/html5-boilerplate-server-configs
-###
-
-
-
-# ----------------------------------------------------------------------
-# Better website experience for IE users
-# ----------------------------------------------------------------------
-
-# Force the latest IE version, in various cases when it may fall back to IE7 mode
-# github.com/rails/rails/commit/123eb25#commitcomment-118920
-# Use ChromeFrame if it's installed for a better experience for the poor IE folk
-
-<IfModule mod_headers.c>
- Header set X-UA-Compatible "IE=Edge,chrome=1"
- # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
- <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
- Header unset X-UA-Compatible
- </FilesMatch>
-</IfModule>
-
-
-# ----------------------------------------------------------------------
-# Cross-domain AJAX requests
-# ----------------------------------------------------------------------
-
-# Serve cross-domain ajax requests, disabled.
-# enable-cors.org
-# code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
-
-# <IfModule mod_headers.c>
-# Header set Access-Control-Allow-Origin "*"
-# </IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Webfont access
-# ----------------------------------------------------------------------
-
-# Allow access from all domains for webfonts.
-# Alternatively you could only whitelist your
-# subdomains like "subdomain.example.com".
-
-<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
- <IfModule mod_headers.c>
- Header set Access-Control-Allow-Origin "*"
- </IfModule>
-</FilesMatch>
-
-
-
-# ----------------------------------------------------------------------
-# Proper MIME type for all files
-# ----------------------------------------------------------------------
-
-
-# JavaScript
-# Normalize to standard type (it's sniffed in IE anyways)
-# tools.ietf.org/html/rfc4329#section-7.2
-AddType application/javascript js
-
-# Audio
-AddType audio/ogg oga ogg
-AddType audio/mp4 m4a
-
-# Video
-AddType video/ogg ogv
-AddType video/mp4 mp4 m4v
-AddType video/webm webm
-
-# SVG.
-# Required for svg webfonts on iPad
-# twitter.com/FontSquirrel/status/14855840545
-AddType image/svg+xml svg svgz
-AddEncoding gzip svgz
-
-# Webfonts
-AddType application/vnd.ms-fontobject eot
-AddType application/x-font-ttf ttf ttc
-AddType font/opentype otf
-AddType application/x-font-woff woff
-
-# Assorted types
-AddType image/x-icon ico
-AddType image/webp webp
-AddType text/cache-manifest appcache manifest
-AddType text/x-component htc
-AddType application/x-chrome-extension crx
-AddType application/x-xpinstall xpi
-AddType application/octet-stream safariextz
-AddType text/x-vcard vcf
-
-
-
-# ----------------------------------------------------------------------
-# Allow concatenation from within specific js and css files
-# ----------------------------------------------------------------------
-
-# e.g. Inside of script.combined.js you could have
-# <!--#include file="libs/jquery-1.5.0.min.js" -->
-# <!--#include file="plugins/jquery.idletimer.js" -->
-# and they would be included into this single file.
-
-# This is not in use in the boilerplate as it stands. You may
-# choose to name your files in this way for this advantage or
-# concatenate and minify them manually.
-# Disabled by default.
-
-#<FilesMatch "\.combined\.js$">
-# Options +Includes
-# AddOutputFilterByType INCLUDES application/javascript application/json
-# SetOutputFilter INCLUDES
-#</FilesMatch>
-#<FilesMatch "\.combined\.css$">
-# Options +Includes
-# AddOutputFilterByType INCLUDES text/css
-# SetOutputFilter INCLUDES
-#</FilesMatch>
-
-
-# ----------------------------------------------------------------------
-# Gzip compression
-# ----------------------------------------------------------------------
-
-<IfModule mod_deflate.c>
-
-# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
-<IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
- </IfModule>
-</IfModule>
-
-# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
-<IfModule filter_module>
- FilterDeclare COMPRESS
- FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
- FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
- FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
- FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
- FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
- FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
- FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
- FilterChain COMPRESS
- FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
-</IfModule>
-
-<IfModule !mod_filter.c>
- # Legacy versions of Apache
- AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
- AddOutputFilterByType DEFLATE application/javascript
- AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
- AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
- AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
-</IfModule>
-</IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Expires headers (for better cache control)
-# ----------------------------------------------------------------------
-
-# These are pretty far-future expires headers.
-# They assume you control versioning with cachebusting query params like
-# <script src="application.js?20100608">
-# Additionally, consider that outdated proxies may miscache
-# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
-
-# If you don't use filenames to version, lower the CSS and JS to something like
-# "access plus 1 week" or so.
-
-<IfModule mod_expires.c>
- ExpiresActive on
-
-# Perhaps better to whitelist expires rules? Perhaps.
- ExpiresDefault "access plus 1 month"
-
-# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
- ExpiresByType text/cache-manifest "access plus 0 seconds"
-
-# Your document html
- ExpiresByType text/html "access plus 0 seconds"
-
-# Data
- ExpiresByType text/xml "access plus 0 seconds"
- ExpiresByType application/xml "access plus 0 seconds"
- ExpiresByType application/json "access plus 0 seconds"
-
-# Feed
- ExpiresByType application/rss+xml "access plus 1 hour"
- ExpiresByType application/atom+xml "access plus 1 hour"
-
-# Favicon (cannot be renamed)
- ExpiresByType image/x-icon "access plus 1 week"
-
-# Media: images, video, audio
- ExpiresByType image/gif "access plus 1 month"
- ExpiresByType image/png "access plus 1 month"
- ExpiresByType image/jpg "access plus 1 month"
- ExpiresByType image/jpeg "access plus 1 month"
- ExpiresByType video/ogg "access plus 1 month"
- ExpiresByType audio/ogg "access plus 1 month"
- ExpiresByType video/mp4 "access plus 1 month"
- ExpiresByType video/webm "access plus 1 month"
-
-# HTC files (css3pie)
- ExpiresByType text/x-component "access plus 1 month"
-
-# Webfonts
- ExpiresByType font/truetype "access plus 1 month"
- ExpiresByType font/opentype "access plus 1 month"
- ExpiresByType application/x-font-woff "access plus 1 month"
- ExpiresByType image/svg+xml "access plus 1 month"
- ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
-
-# CSS and JavaScript
- ExpiresByType text/css "access plus 1 year"
- ExpiresByType application/javascript "access plus 1 year"
-
- <IfModule mod_headers.c>
- Header append Cache-Control "public"
- </IfModule>
-
-</IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# ETag removal
-# ----------------------------------------------------------------------
-
-# FileETag None is not enough for every server.
-<IfModule mod_headers.c>
- Header unset ETag
-</IfModule>
-
-# Since we're sending far-future expires, we don't need ETags for
-# static content.
-# developer.yahoo.com/performance/rules.html#etags
-FileETag None
-
-
-
-# ----------------------------------------------------------------------
-# Stop screen flicker in IE on CSS rollovers
-# ----------------------------------------------------------------------
-
-# The following directives stop screen flicker in IE on CSS rollovers - in
-# combination with the "ExpiresByType" rules for images (see above). If
-# needed, un-comment the following rules.
-
-# BrowserMatch "MSIE" brokenvary=1
-# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
-# BrowserMatch "Opera" !brokenvary
-# SetEnvIf brokenvary 1 force-no-vary
-
-
-
-# ----------------------------------------------------------------------
-# Cookie setting from iframes
-# ----------------------------------------------------------------------
-
-# Allow cookies to be set from iframes (for IE only)
-# If needed, uncomment and specify a path or regex in the Location directive
-
-# <IfModule mod_headers.c>
-# <Location />
-# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
-# </Location>
-# </IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Start rewrite engine
-# ----------------------------------------------------------------------
-
-# Turning on the rewrite engine is necessary for the following rules and features.
-# FollowSymLinks must be enabled for this to work.
-
-<IfModule mod_rewrite.c>
- Options +FollowSymlinks
- RewriteEngine On
-</IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Suppress or force the "www." at the beginning of URLs
-# ----------------------------------------------------------------------
-
-# The same content should never be available under two different URLs - especially not with and
-# without "www." at the beginning, since this can cause SEO problems (duplicate content).
-# That's why you should choose one of the alternatives and redirect the other one.
-
-# By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
-# no-www.org/faq.php?q=class_b
-
-# If you rather want to use option 2, just comment out all option 1 lines
-# and uncomment option 2.
-# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
-
-# ----------------------------------------------------------------------
-
-# Option 1:
-# Rewrite "www.example.com -> example.com"
-
-<IfModule mod_rewrite.c>
- RewriteCond %{HTTPS} !=on
- RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
-</IfModule>
-
-# ----------------------------------------------------------------------
-
-# Option 2:
-# To rewrite "example.com -> www.example.com" uncomment the following lines.
-# Be aware that the following rule might not be a good idea if you
-# use "real" subdomains for certain parts of your website.
-
-# <IfModule mod_rewrite.c>
-# RewriteCond %{HTTPS} !=on
-# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
-# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
-# </IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Built-in filename-based cache busting
-# ----------------------------------------------------------------------
-
-# If you're not using the build script to manage your filename version revving,
-# you might want to consider enabling this, which will route requests for
-# /css/style.20110203.css to /css/style.css
-
-# To understand why this is important and a better idea than all.css?v1231,
-# read: github.com/paulirish/html5-boilerplate/wiki/Version-Control-with-Cachebusting
-
-# Uncomment to enable.
-# <IfModule mod_rewrite.c>
-# RewriteCond %{REQUEST_FILENAME} !-f
-# RewriteCond %{REQUEST_FILENAME} !-d
-# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
-# </IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Prevent SSL cert warnings
-# ----------------------------------------------------------------------
-
-# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
-# https://www.example.com when your cert only allows https://secure.example.com
-# Uncomment the following lines to use this feature.
-
-# <IfModule mod_rewrite.c>
-# RewriteCond %{SERVER_PORT} !^443
-# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
-# </IfModule>
-
-
-
-# ----------------------------------------------------------------------
-# Prevent 404 errors for non-existing redirected folders
-# ----------------------------------------------------------------------
-
-# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
-# e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
-
-Options -MultiViews
-
-
-
-# ----------------------------------------------------------------------
-# Custom 404 page
-# ----------------------------------------------------------------------
-
-# You can add custom pages to handle 500 or 403 pretty easily, if you like.
-ErrorDocument 404 /404.html
-
-
-
-# ----------------------------------------------------------------------
-# UTF-8 encoding
-# ----------------------------------------------------------------------
-
-# Use UTF-8 encoding for anything served text/plain or text/html
-AddDefaultCharset utf-8
-
-# Force UTF-8 for a number of file formats
-AddCharset utf-8 .html .css .js .xml .json .rss .atom
-
-
-
-# ----------------------------------------------------------------------
-# A little more security
-# ----------------------------------------------------------------------
-
-
-# Do we want to advertise the exact version number of Apache we're running?
-# Probably not.
-## This can only be enabled if used in httpd.conf - It will not work in .htaccess
-# ServerTokens Prod
-
-
-# "-Indexes" will have Apache block users from browsing folders without a default document
-# Usually you should leave this activated, because you shouldn't allow everybody to surf through
-# every folder on your server (which includes rather private places like CMS system folders).
-Options -Indexes
-
-
-# Block access to "hidden" directories whose names begin with a period. This
-# includes directories used by version control systems such as Subversion or Git.
-<IfModule mod_rewrite.c>
- RewriteRule "(^|/)\." - [F]
-</IfModule>
-
-
-# If your server is not already configured as such, the following directive
-# should be uncommented in order to set PHP's register_globals option to OFF.
-# This closes a major security hole that is abused by most XSS (cross-site
-# scripting) attacks. For more information: http://php.net/register_globals
-#
-# IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
-#
-# Your server does not allow PHP directives to be set via .htaccess. In that
-# case you must make this change in your php.ini file instead. If you are
-# using a commercial web host, contact the administrators for assistance in
-# doing this. Not all servers allow local php.ini files, and they should
-# include all PHP configurations (not just this one), or you will effectively
-# reset everything to PHP defaults. Consult www.php.net for more detailed
-# information about setting PHP directives.
-
-# php_flag register_globals Off
-
-# Rename session cookie to something else, than PHPSESSID
-# php_value session.name sid
-
-# Do not show you are using PHP
-# Note: Move this line to php.ini since it won't work in .htaccess
-# php_flag expose_php Off
-
-# Level of log detail - log all errors
-# php_value error_reporting -1
-
-# Write errors to log file
-# php_flag log_errors On
-
-# Do not display errors in browser (production - Off, development - On)
-# php_flag display_errors Off
-
-# Do not display startup errors (production - Off, development - On)
-# php_flag display_startup_errors Off
-
-# Format errors in plain text
-# Note: Leave this setting 'On' for xdebug's var_dump() output
-# php_flag html_errors Off
-
-# Show multiple occurrence of error
-# php_flag ignore_repeated_errors Off
-
-# Show same errors from different sources
-# php_flag ignore_repeated_source Off
-
-# Size limit for error messages
-# php_value log_errors_max_len 1024
-
-# Don't precede error with string (doesn't accept empty string, use whitespace if you need)
-# php_value error_prepend_string " "
-
-# Don't prepend to error (doesn't accept empty string, use whitespace if you need)
-# php_value error_append_string " "
-
-# Increase cookie security
-<IfModule php5_module>
- php_value session.cookie_httponly true
-</IfModule>
+++ /dev/null
-html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:700}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}input,select{vertical-align:middle}html{background:#eee;text-align:center;color:#333}a{color:#09489A}h1,h2,h3,h4,h5,h6,th{font-family:Oswald,sans-serif;line-height:1.5em}h1{font-size:36px;padding-top:20px}h2{font-size:24px;padding-top:10px}h3{font-size:18px;padding-top:10px}h4{font-size:16px}h5{font-size:14px}h6{font-size:14px}body,p{font-size:14px;line-height:1.5em;font-family:"Helvetica","Arial",sans-serif}p{margin-bottom:20px}pre,code{font-size:14px;line-height:1.5em;font-family:Consolas,"Courier New",Courier,monospace}pre{background:#ddd;display:block;border:1px solid #ccc;padding:5px 10px;margin-bottom:20px;white-space:pre;white-space:pre-wrap;word-wrap:break-word;border-radius:2px}p code{background:#ddd;padding:3px;border-radius:2px}table{margin-bottom:20px;width:100%}th{font-size:21px;padding:10px 20px}td{border-top:1px solid #313749;padding:5px 20px}td+td{background:rgba(255,255,255,.2)}b,strong{font-weight:700}.footer{height:100px}#navwrap{background-color:#333;background-image:-webkit-gradient(linear,left top,left bottom,from(#333),to(#000));background-image:-webkit-linear-gradient(top,#333,#000);background-image:-moz-linear-gradient(top,#333,#000);background-image:-ms-linear-gradient(top,#333,#000);background-image:-o-linear-gradient(top,#333,#000);background-image:linear-gradient(top,#333,#000);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#333', EndColorStr='#000');height:60px;border-bottom:1px solid #fff}#navwrap h1{float:left;line-height:60px;padding:0;color:#fff;margin-right:100px;padding-left:37px;background:url(../img/clock.png) 0 15px no-repeat}#nav{height:60px;width:960px;margin:0 auto;text-align:left}#navwrap ul{padding:10px 0;height:40px}#navwrap li{line-height:40px;height:40px;margin-right:10px;float:left;list-style:none}#navwrap li a{display:block;font-size:18px;font-family:Oswald,sans-serif;text-decoration:none}#home{margin:50px auto 200px;overflow:hidden;width:960px}#home h2{background:url(../img/clock-large.png) 160px 0 no-repeat;line-height:201px;font-size:100px;text-align:left;padding-left:380px;text-shadow:-1px -1px 0 #fff}#home h3{margin-bottom:50px}#home .col1{width:280px;margin:0 20px;float:left}#home .col2{width:600px;margin:0 20px;float:left;text-align:left}#home h4{height:14px;border-bottom:6px solid #ddd;margin:0 0 40px;text-align:center}#home h4 span{background:#eee;padding:0 10px;line-height:30px;font-size:30px}#home h5{height:8px;border-bottom:6px solid #ddd;margin:0 0 40px;text-align:center}#home h5 span{background:#eee;padding:0 10px;line-height:18px;font-size:18px}.btn{display:block;margin-bottom:20px;text-decoration:none}.btn strong{display:block;font-size:20px;line-height:30px;font-family:Oswald,sans-serif;padding:0 10px}.btn .version{display:block;font-size:16px}.btn .filesize{display:block;font-size:16px}#docnav{width:220px;padding:10px 10px 100px;position:fixed;top:60px;bottom:0;left:0;overflow-x:hidden;overflow-y:scroll;-webkit-overflow-scrolling:touch;text-align:left}#docnav h2{height:18px;border-bottom:6px solid #ddd;margin:0 0 20px;text-align:center}#docnav h2 span{background:#eee;padding:0 10px;line-height:18px;font-size:18px}#docnav h2 a{text-decoration:none;color:#333}#docnav li a{color:#445;display:block;padding:2px 10px;border-radius:4px;cursor:pointer}#docnav li a:hover{background:rgba(0,0,0,.1)}#docnav li{list-style:none;font-size:12px}#docs::-webkit-scrollbar,#docnav::-webkit-scrollbar{height:8px;width:8px}#docs::-webkit-scrollbar-track-piece,#docnav::-webkit-scrollbar-track-piece{margin:10px;border-radius:4px}#docs::-webkit-scrollbar-thumb:vertical,#docnav::-webkit-scrollbar-thumb:vertical{height:25px;background-color:#bbb;-webkit-border-radius:4px}#docs:hover::-webkit-scrollbar-thumb:vertical,#docnav:hover::-webkit-scrollbar-thumb:vertical{background-color:#666}#docs{padding:0 100px 0 40px;position:fixed;top:60px;bottom:0;right:10px;left:242px;overflow-x:hidden;overflow-y:scroll;text-align:left;background:url(../img/gradient.gif) 0 0 repeat-y;-webkit-overflow-scrolling:touch}#docs h2{height:20px;border-bottom:6px solid #bbb;margin:0 0 40px;padding:20px 20px 0}#docs h2 span{background:#eee;padding:0 10px;line-height:36px;font-size:36px}#docs h3{height:14px;border-bottom:6px solid #e6e6e6;margin:0 0 40px;padding:20px 20px 0}#docs h3 span{background:#eee;padding:0 10px;line-height:24px;font-size:24px}#docs h4{margin-bottom:10px}#test{margin:0 auto;width:960px;text-align:left}.sh_typical{background:0;padding:0;margin:0;border:0 none}.sh_typical .sh_sourceCode{color:#586e75;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_keyword{color:#2aa198;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_type{color:#00f;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_string{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_regexp{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_specialchar{color:#C42DA8;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_comment{color:#93a1a1;font-weight:400;font-style:italic}.sh_typical .sh_sourceCode .sh_number{color:#dc322f;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_preproc{color:#00b800;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_symbol{color:#586e75;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_function{color:#586e75;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_cbracket{color:#586e75;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_url{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_date{color:#00f;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_time{color:#00f;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_file{color:#00f;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_ip{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_name{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_variable{color:#268bd2;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_oldfile{color:#C42DA8;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_newfile{color:red;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_difflines{color:#00f;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_selector{color:#ec7f15;font-weight:400;font-style:normal}.sh_typical .sh_sourceCode .sh_property{color:#268bd2;font-weight:700;font-style:normal}.sh_typical .sh_sourceCode .sh_value{color:red;font-weight:400;font-style:normal}.snippet-wrap{position:relative}:first-child+html .snippet-wrap{display:inline-block}* html .snippet-wrap{display:inline-block}.snippet-reveal{text-decoration:underline}.snippet-wrap .snippet-menu,.snippet-wrap .snippet-hide{position:absolute;top:10px;right:15px;font-size:.9em;z-index:1;background-color:transparent}.snippet-wrap .snippet-hide{top:auto;bottom:10px}:first-child+html .snippet-wrap .snippet-hide{bottom:25px}* html .snippet-wrap .snippet-hide{bottom:25px}.snippet-wrap .snippet-menu pre,.snippet-wrap .snippet-hide pre{background-color:transparent;margin:0;padding:0}.snippet-wrap .snippet-menu a,.snippet-wrap .snippet-hide a{padding:0 5px;text-decoration:underline}.snippet-wrap pre.sh_sourceCode{line-height:1.8em;overflow:auto;position:relative}* html .snippet-wrap pre.snippet-formatted{padding:2em 1em}.snippet-reveal pre.sh_sourceCode{text-align:right}.snippet-wrap .snippet-num li{padding-left:1.5em}.snippet-wrap .snippet-no-num{list-style:none;margin:0}.snippet-wrap .snippet-no-num li{list-style:none;min-height:25px}.snippet-wrap .snippet-num{margin:1em 0 1em 1em;padding-left:3em}.snippet-wrap .snippet-num li{list-style:decimal-leading-zero outside none}.snippet-wrap .snippet-no-num li.box{padding:0 6px;margin-left:-6px}.snippet-wrap .snippet-num li.box{border:1px solid;list-style-position:inside;margin-left:-3em;padding-left:6px}:first-child+html .snippet-wrap .snippet-num li.box{margin-left:-2.4em}* html .snippet-wrap .snippet-num li.box{margin-left:-2.4em}.snippet-wrap li.box-top{border-width:1px 1px 0!important}.snippet-wrap li.box-bot{border-width:0 1px 1px!important}.snippet-wrap li.box-mid{border-width:0 1px!important}.snippet-wrap .snippet-num li .box-sp{width:18px;display:inline-block}:first-child+html .snippet-wrap .snippet-num li .box-sp{width:27px}* html .snippet-wrap .snippet-num li .box-sp{width:27px}.snippet-wrap .snippet-no-num li.box{border:1px solid}.snippet-wrap .snippet-no-num li .box-sp{display:none}.btn.minimal{background:#e3e3e3;border:1px solid #bbb;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 1px 1px #f6f6f6;-moz-box-shadow:inset 0 0 1px 1px #f6f6f6;-ms-box-shadow:inset 0 0 1px 1px #f6f6f6;-o-box-shadow:inset 0 0 1px 1px #f6f6f6;box-shadow:inset 0 0 1px 1px #f6f6f6;color:#333;line-height:1;padding:8px 0 9px;text-align:center;text-shadow:0 1px 0 #fff}.btn.minimal:hover{background:#d9d9d9;-webkit-box-shadow:inset 0 0 1px 1px #eaeaea;-moz-box-shadow:inset 0 0 1px 1px #eaeaea;-ms-box-shadow:inset 0 0 1px 1px #eaeaea;-o-box-shadow:inset 0 0 1px 1px #eaeaea;box-shadow:inset 0 0 1px 1px #eaeaea;color:#222;cursor:pointer}.btn.minimal:active{background:#d0d0d0;-webkit-box-shadow:inset 0 0 1px 1px #e3e3e3;-moz-box-shadow:inset 0 0 1px 1px #e3e3e3;-ms-box-shadow:inset 0 0 1px 1px #e3e3e3;-o-box-shadow:inset 0 0 1px 1px #e3e3e3;box-shadow:inset 0 0 1px 1px #e3e3e3;color:#000}.btn.cupid-green{background-color:#7fbf4d;background-image:-webkit-gradient(linear,left top,left bottom,from( #7fbf4d),to( #63a62f));background-image:-webkit-linear-gradient(top, #7fbf4d, #63a62f);background-image:-moz-linear-gradient(top, #7fbf4d, #63a62f);background-image:-ms-linear-gradient(top, #7fbf4d, #63a62f);background-image:-o-linear-gradient(top, #7fbf4d, #63a62f);background-image:linear-gradient(top, #7fbf4d, #63a62f);border:1px solid #63a62f;border-bottom:1px solid #5b992b;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 0 #96ca6d;-moz-box-shadow:inset 0 1px 0 0 #96ca6d;-ms-box-shadow:inset 0 1px 0 0 #96ca6d;-o-box-shadow:inset 0 1px 0 0 #96ca6d;box-shadow:inset 0 1px 0 0 #96ca6d;color:#fff;line-height:1;padding:7px 0 8px 0;text-align:center;text-shadow:0 -1px 0 #4c9021}.btn.cupid-green:hover{background-color:#76b347;background-image:-webkit-gradient(linear,left top,left bottom,from( #76b347),to( #5e9e2e));background-image:-webkit-linear-gradient(top, #76b347, #5e9e2e);background-image:-moz-linear-gradient(top, #76b347, #5e9e2e);background-image:-ms-linear-gradient(top, #76b347, #5e9e2e);background-image:-o-linear-gradient(top, #76b347, #5e9e2e);background-image:linear-gradient(top, #76b347, #5e9e2e);-webkit-box-shadow:inset 0 1px 0 0 #8dbf67;-moz-box-shadow:inset 0 1px 0 0 #8dbf67;-ms-box-shadow:inset 0 1px 0 0 #8dbf67;-o-box-shadow:inset 0 1px 0 0 #8dbf67;box-shadow:inset 0 1px 0 0 #8dbf67;cursor:pointer}.btn.cupid-green:active{border:1px solid #5b992b;border-bottom:1px solid #538c27;-webkit-box-shadow:inset 0 0 8px 4px #548c29,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 8px 4px #548c29,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 8px 4px #548c29,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 8px 4px #548c29,0 1px 0 0 #eee;box-shadow:inset 0 0 8px 4px #548c29,0 1px 0 0 #eee}.btn.clean-gray{background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from( #eee),to( #ccc));background-image:-webkit-linear-gradient(top, #eee, #ccc);background-image:-moz-linear-gradient(top, #eee, #ccc);background-image:-ms-linear-gradient(top, #eee, #ccc);background-image:-o-linear-gradient(top, #eee, #ccc);background-image:linear-gradient(top, #eee, #ccc);border:1px solid #ccc;border-bottom:1px solid #bbb;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;color:#333;line-height:1;padding:8px 10px;text-align:center;text-shadow:0 1px 0 #eee}.btn.clean-gray:hover{background-color:#ddd;background-image:-webkit-gradient(linear,left top,left bottom,from( #ddd),to( #bbb));background-image:-webkit-linear-gradient(top, #ddd, #bbb);background-image:-moz-linear-gradient(top, #ddd, #bbb);background-image:-ms-linear-gradient(top, #ddd, #bbb);background-image:-o-linear-gradient(top, #ddd, #bbb);background-image:linear-gradient(top, #ddd, #bbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.btn.clean-gray:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa;-moz-box-shadow:inset 0 0 5px 2px #aaa;-ms-box-shadow:inset 0 0 5px 2px #aaa;-o-box-shadow:inset 0 0 5px 2px #aaa;box-shadow:inset 0 0 5px 2px #aaa}#qunit-banner{height:20px}#qunit-testrunner-toolbar{padding:.5em 0 .5em 2em;color:#5E740B;background-color:#eee}#qunit-tests{list-style-position:inside;padding-bottom:20px;border-bottom:#313749 10px solid;margin-bottom:20px}#qunit-tests li{padding:5px 10px;list-style-position:inside}#qunit-tests th,#qunit-tests pre{font-size:14px}#qunit-tests.hidepass li.pass{display:none}#qunit-tests li strong{cursor:pointer}#qunit-tests ol{margin-top:.5em;padding:.5em;background-color:#fff}#qunit-tests table{border-collapse:collapse;margin-top:.2em}#qunit-tests th{text-align:right;vertical-align:top;padding:0 .5em 0 0}#qunit-tests td{vertical-align:top}#qunit-tests pre{margin:0;white-space:pre-wrap;word-wrap:break-word}#qunit-tests del{background-color:#e0f2be;color:#374e0c;text-decoration:none}#qunit-tests ins{background-color:#ffcaca;color:#500;text-decoration:none}#qunit-tests b.counts{color:#000}#qunit-tests b.passed{color:#5E740B}#qunit-tests b.failed{color:#710909}#qunit-tests li li{margin:.5em;padding:.4em .5em .4em .5em;background-color:#fff;border-bottom:0;list-style-position:inside}#qunit-tests li li.pass{color:#5E740B;background-color:#fff;border-left:26px solid #C6E746}#qunit-tests .pass .test-name{color:#666}#qunit-tests .pass .test-actual,#qunit-tests .pass .test-expected{color:#999}#qunit-tests .pass b.failed{color:#ccc}#qunit-tests li li.fail{color:#710909;background-color:#fff;border-left:26px solid #EE5757}#qunit-tests .fail{color:#000;background-color:#EE5757}#qunit-tests .fail .test-name,#qunit-tests .fail .module-name{color:#000}#qunit-tests .fail .test-actual{color:#EE5757}#qunit-tests .fail .test-expected{color:green}#qunit-banner.qunit-fail{background-color:#EE5757}.test-expected th{width:100px}#qunit-fixture{position:absolute;top:-10000px;left:-10000px}
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=nocachebuster"><title>Moment.js Documentation</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="docnav"><h2><a href="#/get-it"><span>Get it</span></a></h2><ul><li><a href="#/get-it/github">Github</a></li><li><a href="#/get-it/npm">npm</a></li></ul><h2><a href="#/use-it"><span>Use it</span></a></h2><ul><li><a href="#/use-it/node">In NodeJS</a></li><li><a href="#/use-it/browser">In the browser</a></li></ul><h2><a href="#/parsing"><span>Parsing</span></a></h2><ul><li><a href="#/parsing/date">Javascript Date Object</a></li><li><a href="#/parsing/unix">Unix Timestamp</a></li><li><a href="#/parsing/string">String</a></li><li><a href="#/parsing/string+format">String + Format</a></li><li><a href="#/parsing/string+formats">String + Formats</a></li><li><a href="#/parsing/now">Now</a></li><li><a href="#/parsing/array">Javascript Array</a></li><li><a href="#/parsing/asp-net">ASP.NET json dates</a></li><li><a href="#/parsing/clone">Cloning</a></li></ul><h2><a href="#/manipulation"><span>Manipulation</span></a></h2><ul><li><a href="#/manipulation/add">Add</a></li><li><a href="#/manipulation/subtract">Subtract</a></li><li><a href="#/manipulation/milliseconds">Milliseconds</a></li><li><a href="#/manipulation/seconds">Seconds</a></li><li><a href="#/manipulation/minutes">Minutes</a></li><li><a href="#/manipulation/hours">Hours</a></li><li><a href="#/manipulation/date">Date</a></li><li><a href="#/manipulation/day">Day</a></li><li><a href="#/manipulation/month">Month</a></li><li><a href="#/manipulation/year">Year</a></li><li><a href="#/manipulation/sod">Start of Day</a></li><li><a href="#/manipulation/eod">End of Day</a></li></ul><h2><a href="#/display"><span>Display</span></a></h2><ul><li><a href="#/display/format">Formatted date</a></li><li><a href="#/display/from">Time from another moment</a></li><li><a href="#/display/fromNow">Time from now</a></li><li><a href="#/display/calendar">Calendar time</a></li><li><a href="#/display/diff">Difference</a></li><li><a href="#/display/toDate">Native Javascript Date</a></li><li><a href="#/display/valueOf">Value</a></li><li><a href="#/display/milliseconds">Milliseconds</a></li><li><a href="#/display/seconds">Seconds</a></li><li><a href="#/display/minutes">Minutes</a></li><li><a href="#/display/hours">Hours</a></li><li><a href="#/display/date">Date</a></li><li><a href="#/display/day">Day</a></li><li><a href="#/display/month">Month</a></li><li><a href="#/display/year">Year</a></li><li><a href="#/display/leapyear">Leap Year</a></li><li><a href="#/display/zone">Timezone Offset</a></li><li><a href="#/display/dst">Daylight Savings Time</a></li></ul><h2><a href="#/i18n"><span>I18N</span></a></h2><ul><li><a href="#/i18n/lang">Changing languages</a></li><li><a href="#/i18n/node">Loading languages in NodeJS</a></li><li><a href="#/i18n/browser">Loading languages in the browser</a></li><li><a href="#/i18n/add">Adding your language to Moment.js</a></li></ul><h2><a href="#/custom"><span>Customization</span></a></h2><ul><li><a href="#/custom/months">Month Names</a></li><li><a href="#/custom/monthsShort">Month Abbreviations</a></li><li><a href="#/custom/weekdays">Weekday Names</a></li><li><a href="#/custom/weekdaysShort">Weekday Abbreviations</a></li><li><a href="#/custom/longDateFormats">Long Date Formats</a></li><li><a href="#/custom/relativeTime">Relative Time</a></li><li><a href="#/custom/meridiem">AM/PM</a></li><li><a href="#/custom/calendar">Calendar</a></li><li><a href="#/custom/ordinal">Ordinal</a></li></ul><h2><a href="#/plugins"><span>Plugins</span></a></h2><ul><li><a href="#/plugins/strftime">strftime</a></li></ul></div><div id="docs"><h1>Moment.js Documentation</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><a name="/get-it"></a><h2><span>Where to get it</span></h2><a name="/get-it/github"></a><h3><span>Github</span></h3><a href="https://raw.github.com/timrwood/moment/1.4.0/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.4.0</span><span class="filesize">3.3kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.4.0/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.4.0</span><span class="filesize">22.6kb full source + comments</span></a><p>You can also clone the project with Git by running:</p><pre>git clone git://github.com/timrwood/moment</pre><a name="/get-it/npm"></a><h3><span>npm</span></h3><pre>npm install moment</pre><a name="/use-it"></a><h2><span>Where to use it</span></h2><p>Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.</p><a name="/use-it/node"></a><h3><span>In NodeJS</span></h3><pre>var moment = require('moment');
-moment().add('hours', 1).fromNow(); // "1 hour ago"
-</pre><a name="/use-it/browser"></a><h3><span>In the browser</span></h3><pre><script src="moment.min.js"></script>
-moment().add('hours', 1).fromNow(); // "1 hour ago"
-</pre><a name="/parsing"></a><h2><span>Parsing</span></h2><p>Instead of modifying the native <code>Date.prototype</code>, Moment.js creates a wrapper for the
-<code>Date</code>object.
-</p><p>Note: The Moment.js prototype is exposed through <code>moment.fn</code>. If you want to add your own functions, that is where you would put them.
-</p><p>To get this wrapper object, simply call <code>moment()</code>with one of the supported input types.
-</p><a name="/parsing/date"></a><h3><span>Javascript Date Object</span></h3><p>A native Javascript Date object.</p><pre>var day = new Date(2011, 9, 16);
-var dayWrapper = moment(day);
-</pre><pre>var otherDay = moment(new Date(2020, 3, 7));</pre><p>This is the fastest way to get a Moment.js wrapper.</p><a name="/parsing/unix"></a><h3><span>Unix Timestamp</span></h3><p>An integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC.</p><pre>var day = moment(1318781876406);</pre><a name="/parsing/string"></a><h3><span>String</span></h3><p>A string that can be parsed by <code>Date.parse</code>.
-</p><pre>var day = moment("Dec 25, 1995");</pre><p>Browser support for this is somewhat inconsistent. If you are not getting consistent results, you can try using String + Format.</p><a name="/parsing/string+format"></a><h3><span>String + Format</span></h3><p>An input string and a format string</p><pre>var day = moment("12-25-1995", "MM-DD-YYYY");</pre><p>The format parsing tokens are similar to the tokens for <code>moment.fn.format</code>.
-</p><p>The parser ignores non-alphanumeric characters, so both <code>moment("12-25-1995", "MM-DD-YYYY")</code>and
-<code>moment("12\25\1995", "MM-DD-YYYY")</code>will return the same thing.
-</p><table><tbody><tr><th>Input</th><th>Output</th></tr><tr><td>M or MM</td><td>Month Number (1 - 12)</td></tr><tr><td>MMM or MMMM</td><td>Month Name (In currently language set by <code>moment.lang()</code>)
-</td></tr><tr><td>D or DD</td><td>Day of month</td></tr><tr><td>DDD or DDDD</td><td>Day of year</td></tr><tr><td>d, dd, ddd, or dddd</td><td>Day of week (NOTE: these tokens are not used to create the date, as there are 4-5 weeks in a month, and it would be impossible to get the date based off the day of the week)</td></tr><tr><td>YY</td><td>2 digit year (if greater than 70, will return 1900's, else 2000's)</td></tr><tr><td>YYYY</td><td>4 digit year</td></tr><tr><td>a or A</td><td>AM/PM</td></tr><tr><td>H, HH</td><td>24 hour time</td></tr><tr><td>h, or hh</td><td>12 hour time (use in conjunction with a or A)</td></tr><tr><td>m or mm</td><td>Minutes</td></tr><tr><td>s or ss</td><td>Seconds</td></tr><tr><td>Z or ZZ</td><td>Timezone offset as <code>+0700</code> or
-<code>+07:30</code></td></tr></tbody></table><p>Unless you specify a timezone offset, parsing a string will create a date in the current timezone.</p><p>A workaround to parse a string in UTC is to append <code>"+0000"</code> to the end of your input string, and add
-<code>"ZZ"</code>to the end of your format string.
-</p><p><strong>Important:</strong>Parsing a string with a format is by far the slowest method of creating a date.
-If you have the ability to change the input, it is much faster (~15x) to use Unix timestamps.
-</p><a name="/parsing/string+formats"></a><h3><span>String + Formats</span></h3><p>An input string and an array of format strings.</p><p>This is the same as String + Format, only it will try to match the input to multiple formats.</p><pre>var day = moment("12-25-1995", ["MM-DD-YYYY", "YYYY-MM-DD"]);</pre><p>This approach is fundamentally problematic in cases like the following, where there is a difference in big, medium, or little endian date formats.</p><pre>var day = moment("05-06-1995", ["MM-DD-YYYY", "DD-MM-YYYY"]); // June 5th or May 6th?</pre><p><strong>Important:</strong>THIS IS SLOW. This should only be used as a last line of defense.
-</p><a name="/parsing/now"></a><h3><span>Now</span></h3><p>To get the current date and time, just call <code>moment()</code>with no parameters.
-</p><pre>var now = moment();</pre><p>This is essentially the same as calling <code>moment(new Date())</code>.
-</p><a name="/parsing/array"></a><h3><span>Javascript Array</span></h3><p>An array mirroring the parameters passed into <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date">new Date()</a></p><pre>[year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0]
-var day = moment([2010, 1, 14, 15, 25, 50, 125]); // February 14th, 3:25:50.125 PM
-</pre><p>Any value past the year is optional, and will default to the lowest possible number.</p><pre>var day = moment([2010]); // January 1st
-var day = moment([2010, 6]); // July 1st
-var day = moment([2010, 6, 10]); // July 10th
-</pre><p>Construction with an array will create a date in the current timezone. To create a date from an array at UTC, you can use the following.</p><pre>var array = [2010, 1, 14, 15, 25, 50, 125];
-var day = moment(Date.UTC.apply({}, array));
-</pre><a name="/parsing/asp-net"></a><h3><span>ASP.NET style json dates</span></h3><p>ASP.NET returns dates in json in the following formats. <code>/Date(1198908717056)/</code> or
-<code>/Date(1198908717056-0700)/</code></p><p>If a string that matches this format is passed in, it will be parsed correctly.</p><pre>moment("/Date(1198908717056-0700)/").valueOf(); // 1198908717056</pre><a name="/parsing/clone"></a><h3><span>Cloning</span></h3><p>All moments are mutable. If you want a clone of a moment, you can do so explicitly or implicitly.</p><p>Calling <code>moment()</code> on a moment will clone it.
-</p><pre>var a = moment([2012]);
-var b = moment(a);
-a.year(2000);
-b.year(); // 2012
-</pre><p>Additionally, you can call <code>moment.fn.clone</code> to clone a moment.
-</p><pre>var a = moment([2012]);
-var b = a.clone();
-a.year(2000);
-b.year(); // 2012
-</pre><a name="/manipulation"></a><h2><span>Manipulation</span></h2><p>Once you have a Moment.js wrapper object, you may want to manipulate it in some way. There are a number of <code>moment.fn</code> methods to help with this.
-</p><p>All manipulation methods are chainable, so you can do crazy things like this.</p><pre>moment().add('days', 7).subtract('months', 1).year(2009).hours(0).minutes(0).seconds(0);</pre><p>It should be noted that moments are mutable. Calling any of the manipulation methods will change the original moment.</p><p>If you want to create a copy and manipulate it, you should use <code>moment.fn.clone</code> before manipulating the moment.
-<a href="#/parsing/clone">More info on cloning.</a></p><a name="/manipulation/add"></a><h3><span>Adding Time</span></h3><p>This is a pretty robust function for adding time to an existing date. To add time, pass the key of what time you want to add, and the amount you want to add.
-</p><pre>moment().add('days', 7);</pre><p>There are some shorthand keys as well if you're into that whole brevity thing.</p><pre>moment().add('d', 7);</pre><table><tbody><tr><th>Key</th><th>Shorthand</th></tr><tr><td>years</td><td>y</td></tr><tr><td>months</td><td>M</td></tr><tr><td>weeks</td><td>w</td></tr><tr><td>days</td><td>d</td></tr><tr><td>hours</td><td>h</td></tr><tr><td>minutes</td><td>m</td></tr><tr><td>seconds</td><td>s</td></tr><tr><td>milliseconds</td><td>ms</td></tr></tbody></table><p>If you want to add multiple different keys at the same time, you can pass them in as an object literal.</p><pre>moment().add('days', 7).add('months', 1); // with chaining
-moment().add({days:7,months:1}); // with object literal
-</pre><p>There are no upper limits for the amounts, so you can overload any of the parameters.</p><pre>moment().add('milliseconds', 1000000); // a million milliseconds
-moment().add('days', 360); // 360 days
-</pre><h4>Special considerations for months and years</h4><p>If the day of the month on the original date is greater than the number of days in the final month, the day of the month will change to the last day in the final month.
-</p><p>Example:</p><pre>moment([2010, 0, 31]); // January 31
-moment([2010, 0, 31]).add('months', 1); // February 28
-</pre><p>There are also special considerations to keep in mind when adding time that crosses over Daylight Savings Time.If you are adding years, months, weeks, or days, the original hour will always match the added hour.
-</p><pre>var m = moment(new Date(2011, 2, 12, 5, 0, 0)); // the day before DST in the US
-m.hours(); // 5
-m.add('days', 1).hours(); // 5
-</pre><p>If you are adding hours, minutes, seconds, or milliseconds, the assumption is that you want precision to the hour, and will result in a different hour.</p><pre>var m = moment(new Date(2011, 2, 12, 5, 0, 0)); // the day before DST in the US
-m.hours(); // 5
-m.add('hours', 24).hours(); // 6
-</pre><a name="/manipulation/subtract"></a><h3><span>Subtracting Time</span></h3><p>This is exactly the same as <code>moment.fn.add</code>, only instead of adding time, it subtracts time.
-</p><pre>moment().subtract('days', 7);</pre><a name="/manipulation/milliseconds"></a><h3><span>Milliseconds</span></h3><p>There are a number of shortcut getter and setter functions. Much like in jQuery, calling the function without paremeters causes it to function as a getter,
-and calling with a parameter causes it to function as a setter.
-</p><p>These map to the corresponding function on the native <code>Date</code>object.
-</p><pre>moment().milliseconds(30) === new Date().setMilliseconds(30);
-moment().milliseconds() === new Date().getMilliseconds();
-</pre><p>Accepts numbers from 0 to 999</p><a name="/manipulation/seconds"></a><h3><span>Seconds</span></h3><p>Accepts numbers from 0 to 59</p><pre>moment().seconds(30); // set the seconds to 30</pre><a name="/manipulation/minutes"></a><h3><span>Minutes</span></h3><p>Accepts numbers from 0 to 59</p><pre>moment().minutes(30); // set the minutes to 30</pre><a name="/manipulation/hours"></a><h3><span>Hours</span></h3><p>Accepts numbers from 0 to 23</p><pre>moment().hours(12); // set the hours to 12</pre><a name="/manipulation/date"></a><h3><span>Date</span></h3><p>Accepts numbers from 1 to 31</p><pre>moment().date(5); // set the date to 5</pre><p>NOTE: <code>moment.fn.date</code> is used to set the date of the month, and
-<code>moment.fn.day</code> is used to set the day of the week.
-</p><a name="/manipulation/day"></a><h3><span>Day</span></h3><pre>moment().day(5); // set the day of the week to Friday</pre><p>This method can be used to set the day of the week, Sunday being 0 and Saturday being 6.</p><p><code>moment.fn.day</code> can also be overloaded to set to a weekday of the previous week, next week, or a week any distance from the moment.
-</p><pre>moment().day(-7); // set to last Sunday (0 - 7)
-moment().day(7); // set to next Sunday (0 + 7)
-moment().day(10); // set to next Wednesday (3 + 7)
-moment().day(24); // set to 3 Wednesdays from now (3 + 7 + 7 + 7)
-</pre><a name="/manipulation/month"></a><h3><span>Month</span></h3><p>Accepts numbers from 0 to 11</p><pre>moment().month(5); // set the month to June</pre><a name="/manipulation/year"></a><h3><span>Year</span></h3><pre>moment().year(1984); // set the year to 1984</pre><a name="/manipulation/sod"></a><h3><span>Start of Day</span></h3><pre>moment().sod(); // set the time to last midnight</pre><p>This is essentially the same as the following.</p><pre>moment().hours(0).minutes(0).seconds(0).milliseconds(0);</pre><a name="/manipulation/eod"></a><h3><span>End of Day</span></h3><pre>moment().eod(); // set the time to 11:59:59.999 pm tonight</pre><p>This is essentially the same as the following.</p><pre>moment().hours(23).minutes(59).seconds(59).milliseconds(999);</pre><a name="/display"></a><h2><span>Display</span></h2><p>Once parsing and manipulation are done, you need some way to display the moment. Moment.js offers many ways of doing that.</p><a name="/display/format"></a><h3><span>Formatted Date</span></h3><p>The most robust display option is <code>moment.fn.format</code>. It takes a string of tokens and replaces them with their corresponding values from the Date object.
-</p><pre>var date = new Date(2010, 1, 14, 15, 25, 50, 125);
-moment(date).format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
-moment(date).format("ddd, hA"); // "Sun, 3PM"
-</pre><table><tbody><tr><th>Token</th><th>Output</th></tr><tr><td><b>Month</b></td><td></td></tr><tr><td>M</td><td>1 2 ... 11 12</td></tr><tr><td>Mo</td><td>1st 2nd ... 11th 12th</td></tr><tr><td>MM</td><td>01 02 ... 11 12</td></tr><tr><td>MMM</td><td>Jan Feb ... Nov Dec</td></tr><tr><td>MMMM</td><td>January February ... November December</td></tr><tr><td><b>Day of Month</b></td><td></td></tr><tr><td>D</td><td>1 2 ... 30 30</td></tr><tr><td>Do</td><td>1st 2nd ... 30th 31st</td></tr><tr><td>DD</td><td>01 02 ... 30 31</td></tr><tr><td><b>Day of Year</b></td><td></td></tr><tr><td>DDD</td><td>1 2 ... 364 365</td></tr><tr><td>DDDo</td><td>1st 2nd ... 364th 365th</td></tr><tr><td>DDDD</td><td>001 002 ... 364 365</td></tr><tr><td><b>Day of Week</b></td><td></td></tr><tr><td>d</td><td>0 1 ... 5 6</td></tr><tr><td>do</td><td>0th 1st ... 5th 6th</td></tr><tr><td>ddd</td><td>Sun Mon ... Fri Sat</td></tr><tr><td>dddd</td><td>Sunday Monday ... Friday Saturday</td></tr><tr><td><b>Week of Year</b></td><td></td></tr><tr><td>w</td><td>1 2 ... 52 53</td></tr><tr><td>wo</td><td>1st 2nd ... 52nd 53rd</td></tr><tr><td>ww</td><td>01 02 ... 52 53</td></tr><tr><td><b>Year</b></td><td></td></tr><tr><td>YY</td><td>70 71 ... 29 30</td></tr><tr><td>YYYY</td><td>1970 1971 ... 2029 2030</td></tr><tr><td><b>AM/PM</b></td><td></td></tr><tr><td>A</td><td>AM PM</td></tr><tr><td>a</td><td>am pm</td></tr><tr><td><b>Hour</b></td><td></td></tr><tr><td>H</td><td>0 1 ... 22 23</td></tr><tr><td>HH</td><td>00 01 ... 22 23</td></tr><tr><td>h</td><td>1 2 ... 11 12</td></tr><tr><td>hh</td><td>01 02 ... 11 12</td></tr><tr><td><b>Minute</b></td><td></td></tr><tr><td>m</td><td>0 1 ... 58 59</td></tr><tr><td>mm</td><td>00 01 ... 58 59</td></tr><tr><td><b>Second</b></td><td></td></tr><tr><td>s</td><td>0 1 ... 58 59</td></tr><tr><td>ss</td><td>00 01 ... 58 59</td></tr><tr><td><b>Timezone</b></td><td></td></tr><tr><td>z or zz (lowercase)</td><td>EST CST ... MST PST</td></tr><tr><td>Z</td><td>-07:00 -06:00 ... +06:00 +07:00</td></tr><tr><td>ZZ</td><td>-0700 -0600 ... +0600 +0700</td></tr><tr><td><b>Localized date format</b></td><td></td></tr><tr><td>LT</td><td>8:30 PM</td></tr><tr><td>L</td><td>07/10/1986</td></tr><tr><td>LL</td><td>July 10 1986</td></tr><tr><td>LLL</td><td>July 10 1986 8:30 PM</td></tr><tr><td>LLLL</td><td>Saturday, July 10 1986 8:30 PM</td></tr></tbody></table><p>To escape characters in format strings, you can use a backslash before any character. NOTE: if you are using a string literal, you will need to escape the backslash, hence the double backslash below.</p><pre>moment().format('\\L'); // outputs 'L'</pre><p>To escape multiple characters, you can wrap the characters in square brackets.</p><pre>moment().format('[today] DDDD'); // 'today Sunday'</pre><p>While these date formats are very similar to LDML date formats, there are a few minor differences regarding day of month, day of year, and day of week.</p><p>For a breakdown of a few different date formatting tokens, see <a href="https://docs.google.com/spreadsheet/ccc?key=0AtgZluze7WMJdDBOLUZfSFIzenIwOHNjaWZoeGFqbWc&hl=en_US#gid=0">this chart of date formatting tokens.</a></p><p>To compare moment.js date formatting speeds against other libraries, check out <a href="http://jsperf.com/date-formatting">http://jsperf.com/date-formatting</a> .
-</p><p>Note: Baron Schwartz wrote a pretty cool date formatter that caches formatting functions to avoid expensive regex or string splitting. It's so much faster than any of the other libraries, that it's best to compare it on its own, rather than pollute the "best of the uncompiled" formatting libs.</p><p>Here's the <a href="http://jsperf.com/momentjs-vs-xaprb">moment.js vs xaprb</a> performance tests, and here is the
-<a href="http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/">article describing his methods.</a></p><p>If you are more comfortable working with strftime instead of LDML-like parsing tokens, you can use Ben Oakes' plugin <code>moment-strftime</code> .
-</p><p>It is available on npm.</p><pre>npm install moment-strftime</pre><p>The repository is located at <a href="https://github.com/benjaminoakes/moment-strftime">benjaminoakes/moment-strftime</a></p><a name="/display/from"></a><h3><span>Time from another moment</span></h3><p>Another common way of displaying time, sometimes called timeago, is handled by <code>moment.fn.from</code>.
-</p><pre>var a = moment([2007, 0, 29]);
-var b = moment([2007, 0, 28]);
-a.from(b) // "a day ago"
-</pre><p>The first parameter is anything you can pass to <code>moment()</code>or a Moment.js object.
-</p><pre>var a = moment([2007, 0, 29]);
-var b = moment([2007, 0, 28]);
-a.from(b); // "a day ago"
-a.from([2007, 0, 28]); // "a day ago"
-a.from(new Date(2007, 0, 28)); // "a day ago"
-a.from("1-28-2007"); // "a day ago"
-</pre><p>NOTE: Because it only accepts one parameter to pass in the date info, if you need to use String + Format or String + Formats, you should create a Moment.js
-object first and then call
-<code>moment.fn.from</code></p><pre>var a = moment();
-var b = moment("10-10-1900", "MM-DD-YYYY");
-a.from(b);
-</pre><p>If you pass <code>true</code>as the second parameter, you can get the value without the suffix. This is useful wherever you need to have a human readable length of time.
-</p><pre>var start = moment([2007, 0, 5]);
-var end = moment([2007, 0, 10]);
-start.from(end); // "in 5 days"
-start.from(end, true); // "5 days"
-</pre><p>The base strings are customized by <code>moment.lang</code>or by modifying the values directly using
-<code>moment.relativeTime</code>.
-</p><p>The breakdown of which string is displayed when is outlined in the table below.</p><table><thead><tr><th>Range</th><th>Key</th><th>Sample Output</th></tr></thead><tbody><tr><td>0 to 45 seconds</td><td>s</td><td>seconds ago</td></tr><tr><td>45 to 90 seconds</td><td>m</td><td>a minute ago</td></tr><tr><td>90 seconds to 45 minutes</td><td>mm</td><td>2 minutes ago ... 45 minutes ago</td></tr><tr><td>45 to 90 minutes</td><td>h</td><td>an hour ago</td></tr><tr><td>90 minutes to 22 hours </td><td>hh</td><td>2 hours ago ... 22 hours ago</td></tr><tr><td>22 to 36 hours</td><td>d</td><td>a day ago</td></tr><tr><td>36 hours to 25 days</td><td>dd</td><td>2 days ago ... 25 days ago</td></tr><tr><td>25 to 45 days</td><td>M</td><td>a month ago</td></tr><tr><td>45 to 345 days</td><td>MM</td><td>2 months ago ... 11 months ago</td></tr><tr><td>345 to 547 days (1.5 years)</td><td>y</td><td>a year ago</td></tr><tr><td>548 days+</td><td>yy</td><td>2 years ago ... 20 years ago</td></tr></tbody></table><a name="/display/fromNow"></a><h3><span>Time from now</span></h3><p>This is just a map to <code>moment.fn.from(new Date())</code></p><pre>moment([2007, 0, 29]).fromNow(); // 4 years ago</pre><p>Like <code>moment.fn.from</code>, if you pass
-<code>true</code>as the second parameter, you can get the value without the suffix.
-</p><pre>moment([2007, 0, 29]).fromNow(); // 4 years ago
-moment([2007, 0, 29]).fromNow(true); // 4 years
-</pre><a name="/display/calendar"></a><h3><span>Calendar time</span></h3><p>Calendar time is displays time relative to now, but slightly differently than <code>moment.fn.from</code>.
-</p><p><code>moment.fn.calendar</code> will format a date with different strings depending on how close to today the date is.
-</p><table><tr><td>Last week</td><td>Last Monday 2:30 AM</td></tr><tr><td>The day before</td><td>Yesterday 2:30 AM</td></tr><tr><td>The same day</td><td>Today 2:30 AM</td></tr><tr><td>The next day</td><td>Tomorrow 2:30 AM</td></tr><tr><td>The next week</td><td>Sunday 2:30 AM</td></tr><tr><td>Everything else</td><td>7/10/2011</td></tr></table><p>These strings are localized, and can be customized with <a href="#/custom/calendar">moment.calendar</a> or
-<a href="#/i18n/lang">moment.lang</a>.
-</p><a name="/display/diff"></a><h3><span>Difference</span></h3><p>To get the difference in milliseconds, use <code>moment.fn.diff</code> like you would use
-<code>moment.fn.from</code>.
-</p><pre>var a = moment([2007, 0, 29]);
-var b = moment([2007, 0, 28]);
-a.diff(b) // 86400000
-</pre><p>To get the difference in another unit of measurement, pass that measurement as the second argument.</p><pre>var a = moment([2007, 0, 29]);
-var b = moment([2007, 0, 28]);
-a.diff(b, 'days') // 1
-</pre><p>The supported measurements are <code>"years", "months", "weeks", "days", "hours", "minutes", and "seconds"</code></p><p>By default, <code>moment.fn.diff</code>will return a rounded number. If you want the floating point number, pass
-<code>true</code>as the third argument.
-</p><pre>var a = moment([2007, 0]);
-var b = moment([2008, 5]);
-a.diff(b, 'years') // 1
-a.diff(b, 'years', true) // 1.5
-</pre><a name="/display/toDate"></a><a name="/display/native"></a><h3><span>Native Javascript Date</span></h3><p>To get the native Date object that Moment.js wraps, use <code>moment.fn.toDate</code>.
-</p><pre>moment([2007, 0, 29]).toDate(); // returns native Date object</pre><p>Note: <code>moment.fn.native</code> has been replaced by
-<code>moment.fn.toDate</code> and will be depreciated in the future.
-</p><a name="/display/valueOf"></a><h3><span>Value</span></h3><p><code>moment.fn.valueOf </code>simply outputs the unix timestamp.
-</p><pre>moment(1318874398806).valueOf(); // 1318874398806</pre><a name="/display/milliseconds"></a><h3><span>Milliseconds</span></h3><p>These are the getters mentioned in the <a href="#/manipulation/milliseconds">Manipulation</a>section above.
-</p><p>These map to the corresponding function on the native <code>Date</code>object.
-</p><pre>moment().milliseconds() === new Date().getMilliseconds();</pre><pre>moment().milliseconds(); // get the milliseconds (0 - 999)</pre><a name="/display/seconds"></a><h3><span>Seconds</span></h3><pre>moment().minutes(); // get the seconds (0 - 59)</pre><a name="/display/minutes"></a><h3><span>Minutes</span></h3><pre>moment().minutes(); // get the minutes (0 - 59)</pre><a name="/display/hours"></a><h3><span>Hours</span></h3><pre>moment().hours(); // get the hours (0 - 23)</pre><a name="/display/date"></a><h3><span>Date</span></h3><pre>moment().date(); // get the date of the month (1 - 31)</pre><a name="/display/day"></a><h3><span>Day</span></h3><pre>moment().day(); // get the day of the week (0 - 6)</pre><a name="/display/month"></a><h3><span>Month</span></h3><pre>moment().month(); // get the month (0 - 11)</pre><a name="/display/year"></a><h3><span>Year</span></h3><pre>moment().year(); // get the four digit year</pre><a name="/display/leapyear"></a><h3><span>Leap Year</span></h3><p><code>moment.fn.isLeapYear</code>returns true if that year is a leap year, and false if it is not.
-</p><pre>moment([2000]).isLeapYear() // true
-moment([2001]).isLeapYear() // false
-moment([2100]).isLeapYear() // false
-</pre><a name="/display/zone"></a><h3><span>Timezone Offset</span></h3><pre>moment().zone(); // get the timezone offset in minutes (60, 120, 240, etc.)</pre><a name="/display/dst"></a><h3><span>Daylight Savings Time</span></h3><p><code>moment.fn.isDST</code> checks if the current moment is in daylight savings time or not.
-</p><pre>moment([2011, 2, 12]).isDST(); // false, March 12 2011 is not DST
-moment([2011, 2, 14]).isDST(); // true, March 14 2011 is DST
-</pre><a name="/i18n"></a><h2><span>I18N</span></h2><p>Moment.js has pretty robust support for internationalization. You can load multiple languages onto the same instance and easily switch between them.</p><a name="/i18n/lang"></a><h3><span>Changing languages</span></h3><p>By default, Moment.js comes with English language strings. If you need other languages, you can load them into Moment.js for later use.</p><p>To load a language, pass the key and the string values to <code>moment.lang</code>.
-</p><p>Note: More details on each of the parts of the language bundle can be found in the <a href="#/custom">customization</a> section.
-</p><pre>moment.lang('fr', {
- months : "Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),
- monthsShort : "Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),
- weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),
- weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),
- longDateFormat : {
- L : "DD/MM/YYYY",
- LL : "D MMMM YYYY",
- LLL : "D MMMM YYYY HH:mm",
- LLLL : "dddd, D MMMM YYYY HH:mm"
- },
- meridiem : {
- AM : 'AM',
- am : 'am',
- PM : 'PM',
- pm : 'pm'
- },
- calendar : {
- sameDay: "[Ajourd'hui à] LT",
- nextDay: '[Demain à] LT',
- nextWeek: 'dddd [à] LT',
- lastDay: '[Hier à] LT',
- lastWeek: 'dddd [denier à] LT',
- sameElse: 'L'
- },
- relativeTime : {
- future : "in %s",
- past : "il y a %s",
- s : "secondes",
- m : "une minute",
- mm : "%d minutes",
- h : "une heure",
- hh : "%d heures",
- d : "un jour",
- dd : "%d jours",
- M : "un mois",
- MM : "%d mois",
- y : "une année",
- yy : "%d années"
- },
- ordinal : function (number) {
- return (~~ (number % 100 / 10) === 1) ? 'er' : 'ème';
- }
-});
-</pre><p>Once you load a language, it becomes the active language. To change active languages, simply call <code>moment.lang</code>with the key of a loaded language.
-</p><pre>moment.lang('fr');
-moment(1316116057189).fromNow() // il y a une heure
-moment.lang('en');
-moment(1316116057189).fromNow() // an hour ago
-</pre><a name="/i18n/node"></a><h3><span>Loading languages in NodeJS</span></h3><p>Loading languages in NodeJS is super easy. If there is a language file in <code>moment/lang/</code>named after that key, the first call to
-<code>moment.lang</code>will load it.
-</p><pre>var moment = require('moment');
-moment.lang('fr');
-moment(1316116057189).fromNow(); // il y a une heure
-</pre><p>Right now, there is only support for English, French, Italian, and Portuguese. If you want your language supported, create a pull request or send me an email with the
-<a href="#/i18n/add">required files</a>.
-</p><a name="/i18n/browser"></a><h3><span>Loading languages in the browser</span></h3><p>Loading languages in the browser just requires you to include the language files.</p><pre><script src="moment.min.js"></script>
-<script src="lang/fr.js"></script>
-<script src="lang/pt.js"></script>
-</pre><p>There are minified versions of each of these languages. There is also a minified version of all of the languages bundled together.</p><pre><script src="moment.min.js"></script><script src="lang/all.min.js"></script>
-</pre><p>Ideally, you would bundle all the files you need into one file to minimize http requests.</p><pre><script src="moment-fr-it.min.js"></script></pre><a name="/i18n/add"></a><h3><span>Adding your language to Moment.js</span></h3><p>To add your language to Moment.js, submit a pull request with both a language file and a test file. You can find examples in <code>moment/lang/fr.js</code>and
-<code>moment/test/lang/fr.js</code></p><p>To run the tests, do <code>node build</code>.
-</p><p>If there are no errors building, then do <code>node test</code>or open
-<code>moment/test/index.html</code>.
-</p><p>If all the tests pass, submit that pull request, and thank you for contributing!</p><a name="/custom"></a><h2><span>Customization</span></h2><p>If you don't need i18n support, you can manually override the customization values. However, any calls to
-<code>moment.lang</code>will override them. It is probably safer to create a language for your specific customizations than to override these values manually.
-</p><a name="/custom/months"></a><h3><span>Month Names</span></h3><p><code>moment.months</code>should be an array of the month names.
-</p><pre>moment.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];</pre><a name="/custom/monthsShort"></a><h3><span>Month Abbreviations</span></h3><p><code>moment.monthsShort</code>should be an array of the month abbreviations.
-</p><pre>moment.monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];</pre><a name="/custom/weekdays"></a><h3><span>Weekday Names</span></h3><p><code>moment.weekdays</code>should be an array of the weekdays names.
-</p><pre>moment.weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];</pre><a name="/custom/weekdaysShort"></a><h3><span>Weekday Abbreviations</span></h3><p><code>moment.weekdaysShort</code>should be an array of the weekdays abbreviations.
-</p><pre>moment.weekdaysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];</pre><a name="/custom/longDateFormats"></a><h3><span>Long Date Formats</span></h3><p><code>moment.longDateFormat</code>should be an object containing a key/value pair for each long date format (L, LL, LLL, LLLL).
-</p><pre>moment.longDateFormat = {
- L: "MM/DD/YYYY",
- LL: "MMMM D YYYY",
- LLL: "MMMM D YYYY h:mm A",
- LLLL: "dddd, MMMM D YYYY h:mm A"
-};
-</pre><a name="/custom/relativeTime"></a><h3><span>Relative Time</span></h3><p><code>moment.relativeTime</code> should be an object of the replacement strings for
-<code>moment.fn.from</code>.
-</p><pre>moment.relativeTime = {
- future: "in %s",
- past: "%s ago",
- s: "seconds",
- m: "a minute",
- mm: "%d minutes",
- h: "an hour",
- hh: "%d hours",
- d: "a day",
- dd: "%d days",
- M: "a month",
- MM: "%d months",
- y: "a year",
- yy: "%d years"
-};
-</pre><p><code>future</code> refers to the prefix/suffix for future dates, and
-<code>past</code> refers to the prefix/suffix for past dates. For all others, a single character refers to the singular, and an double character refers to the plural.
-</p><p>If a language requires additional processing for a token, It can set the token as a function with the following signature. The function should return a string.
-</p><pre>function(number, withoutSuffix, key) {
- return string;
-}
-</pre><p>The <code>key</code> variable refers to the replacement key in the
-<code>relativeTime </code> object. (eg. 's', 'm', 'mm', 'h', etc.)
-</p><p>The <code>number</code> variable refers to the number of units for that key. For 'm', the number is the number of minutes, etc.
-</p><p>The <code>withoutSuffix</code> variable will be true if the token will be displayed without a suffix, and false if it will be displayed with a suffix.
-(The reason for the inverted logic is because the default behavior is to display with the suffix.)
-</p><a name="/custom/meridiem"></a><h3><span>AM/PM</span></h3><p><code>moment.meridiem</code> should be a map of upper and lowercase versions of am/pm.
-</p><pre>moment.meridiem = {
- am : 'am',
- AM : 'AM',
- pm : 'pm',
- PM : 'PM'
-};
-</pre><a name="/custom/calendar"></a><h3><span>Calendar</span></h3><p><code>moment.calendar</code> should have the following formatting strings.
-</p><pre>moment.calendar = {
- lastDay : '[Yesterday at] LT',
- sameDay : '[Today at] LT',
- nextDay : '[Tomorrow at] LT',
- lastWeek : '[last] dddd [at] LT',
- nextWeek : 'dddd [at] LT',
- sameElse : 'L'
-};
-</pre><a name="/custom/ordinal"></a><h3><span>Ordinal</span></h3><p><code>moment.ordinal</code> should be a function that returns the ordinal for a given number.
-</p><pre>moment.ordinal = function (number) {
- var b = number % 10;
- return (~~ (number % 100 / 10) === 1) ? 'th' :
- (b === 1) ? 'st' :
- (b === 2) ? 'nd' :
- (b === 3) ? 'rd' : 'th';
-};
-</pre><p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p><a name="/plugins"></a><h2><span>Plugins</span></h2><p>Some people have made plugins for moment.js that may be useful to you.</p><a name="/plugins/strftime"></a><h3><span>strftime</span></h3><p>If you are more comfortable working with strftime instead of LDML-like parsing tokens, you can use Ben Oakes' plugin <code>moment-strftime</code> .
-</p><p>It is available on npm.</p><pre>npm install moment-strftime</pre><p>The repository is located at <a href="https://github.com/benjaminoakes/moment-strftime">benjaminoakes/moment-strftime</a></p><div class="footer"></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/docs.min.js?_=nocachebuster"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
-(function(d, c) {
- var ga = d.createElement(c); ga.async = true;
- ga.src = "http://www.google-analytics.com/ga.js";
- var s = d.getElementsByTagName(c)[0];
- s.parentNode.insertBefore(ga, s);
-})(document, 'script');
-</script></body></html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="css/style.css?_=nocachebuster"><title>Moment.js - A lightweight javascript date library</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="home"><h2>Moment.js</h2><h3>A lightweight javascript date library for parsing, manipulating, and formatting dates.</h3><div class="col1"><h4><span>Get it</span></h4><pre>npm install moment</pre><a href="https://raw.github.com/timrwood/moment/1.4.0/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.4.0</span><span class="filesize">3.3kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.4.0/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.4.0</span><span class="filesize">22.6kb full source + comments</span></a></div><div class="col2"><h4><span>Use it</span></h4><pre class="js">var now = moment();
-console.log(now.format('dddd, MMMM Do YYYY, h:mm:ss a'));
-</pre><h5><span id="js-format-now"></span></h5><pre class="js">var halloween = moment([2011, 9, 31]); // October 31st
-console.log(halloween.fromNow());
-</pre><h5><span id="js-from-now"></span></h5><pre class="js">var now = moment().add('days', 9);
-console.log(now.format('dddd, MMMM Do YYYY'));
-</pre><h5><span id="js-add"></span></h5><pre class="js">var now = moment();
-moment.lang('fr');
-console.log(now.format('LLLL'));
-</pre><h5><span id="js-lang"></span></h5></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js?_=nocachebuster"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
-(function(d, c) {
- var ga = d.createElement(c); ga.async = true;
- ga.src = "http://www.google-analytics.com/ga.js";
- var s = d.getElementsByTagName(c)[0];
- s.parentNode.insertBefore(ga, s);
-})(document, 'script');
-</script></body></html>
\ No newline at end of file
+++ /dev/null
-function snippetPopup(a){top.consoleRef=window.open("","myconsole","width=600,height=300,left=50,top=50,menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable=1"),top.consoleRef.document.writeln("<html><head><title>Snippet :: Code View :: "+location.href+"</title></head>"+'<body bgcolor=white onLoad="self.focus()">'+"<pre>"+a+"</pre>"+"</body></html>"),top.consoleRef.document.close()}function sh_isEmailAddress(a){return/^mailto:/.test(a)?!1:a.indexOf("@")!==-1}function sh_setHref(a,b,c){var d=c.substring(a[b-2].pos,a[b-1].pos);d.length>=2&&d.charAt(0)==="<"&&d.charAt(d.length-1)===">"&&(d=d.substr(1,d.length-2)),sh_isEmailAddress(d)&&(d="mailto:"+d),a[b-2].node.href=d}function sh_konquerorExec(a){var b=[""];return b.index=a.length,b.input=a,b}function sh_highlightString(a,b){if(/Konqueror/.test(navigator.userAgent)&&!b.konquered){for(var c=0;c<b.length;c++)for(var d=0;d<b[c].length;d++){var e=b[c][d][0];e.source==="$"&&(e.exec=sh_konquerorExec)}b.konquered=!0}var f=document.createElement("a"),g=document.createElement("span"),h=[],i=0,j=[],k=0,l=null,m=function(b,c){var d=b.length;if(d===0)return;if(!c){var e=j.length;if(e!==0){var m=j[e-1];m[3]||(c=m[1])}}if(l!==c){l&&(h[i++]={pos:k},l==="sh_url"&&sh_setHref(h,i,a));if(c){var n;c==="sh_url"?n=f.cloneNode(!1):n=g.cloneNode(!1),n.className=c,h[i++]={node:n,pos:k}}}k+=d,l=c},n=/\r\n|\r|\n/g;n.lastIndex=0;var o=a.length;while(k<o){var p=k,q,r,s=n.exec(a);s===null?(q=o,r=o):(q=s.index,r=n.lastIndex);var t=a.substring(p,q),u=[];for(;;){var v=k-p,w,x=j.length;x===0?w=0:w=j[x-1][2];var y=b[w],z=y.length,A=u[w];A||(A=u[w]=[]);var B=null,C=-1;for(var D=0;D<z;D++){var E;if(D<A.length&&(A[D]===null||v<=A[D].index))E=A[D];else{var F=y[D][0];F.lastIndex=v,E=F.exec(t),A[D]=E}if(E!==null&&(B===null||E.index<B.index)){B=E,C=D;if(E.index===v)break}}if(B===null){m(t.substring(v),null);break}B.index>v&&m(t.substring(v,B.index),null);var G=y[C],H=G[1],I;if(H instanceof Array)for(var J=0;J<H.length;J++)I=B[J+1],m(I,H[J]);else I=B[0],m(I,H);switch(G[2]){case-1:break;case-2:j.pop();break;case-3:j.length=0;break;default:j.push(G)}}l&&(h[i++]={pos:k},l==="sh_url"&&sh_setHref(h,i,a),l=null),k=r}return h}function sh_getClasses(a){var b=[],c=a.className;if(c&&c.length>0){var d=c.split(" ");for(var e=0;e<d.length;e++)d[e].length>0&&b.push(d[e])}return b}function sh_addClass(a,b){var c=sh_getClasses(a);for(var d=0;d<c.length;d++)if(b.toLowerCase()===c[d].toLowerCase())return;c.push(b),a.className=c.join(" ")}function sh_extractTagsFromNodeList(a,b){var c=a.length;for(var d=0;d<c;d++){var e=a.item(d);switch(e.nodeType){case 1:if(e.nodeName.toLowerCase()==="br"){var f;/MSIE/.test(navigator.userAgent)?f="\r":f="\n",b.text.push(f),b.pos++}else b.tags.push({node:e.cloneNode(!1),pos:b.pos}),sh_extractTagsFromNodeList(e.childNodes,b),b.tags.push({pos:b.pos});break;case 3:case 4:b.text.push(e.data),b.pos+=e.length}}}function sh_extractTags(a,b){var c={};return c.text=[],c.tags=b,c.pos=0,sh_extractTagsFromNodeList(a.childNodes,c),c.text.join("")}function sh_mergeTags(a,b){var c=a.length;if(c===0)return b;var d=b.length;if(d===0)return a;var e=[],f=0,g=0;while(f<c&&g<d){var h=a[f],i=b[g];h.pos<=i.pos?(e.push(h),f++):(e.push(i),b[g+1].pos<=h.pos?(g++,e.push(b[g]),g++):(e.push({pos:h.pos}),b[g]={node:i.node.cloneNode(!1),pos:h.pos}))}while(f<c)e.push(a[f]),f++;while(g<d)e.push(b[g]),g++;return e}function sh_insertTags(a,b){var c=document,d=document.createDocumentFragment(),e=0,f=a.length,g=0,h=b.length,i=d;while(g<h||e<f){var j,k;e<f?(j=a[e],k=j.pos):k=h;if(k<=g){if(j.node){var l=j.node;i.appendChild(l),i=l}else i=i.parentNode;e++}else i.appendChild(c.createTextNode(b.substring(g,k))),g=k}return d}function sh_highlightElement(a,b){sh_addClass(a,"sh_sourceCode");var c=[],d=sh_extractTags(a,c),e=sh_highlightString(d,b),f=sh_mergeTags(c,e),g=sh_insertTags(f,d);while(a.hasChildNodes())a.removeChild(a.firstChild);a.appendChild(g)}function sh_getXMLHttpRequest(){if(window.ActiveXObject)return new ActiveXObject("Msxml2.XMLHTTP");if(window.XMLHttpRequest)return new XMLHttpRequest;throw"No XMLHttpRequest implementation available"}function sh_load(language,element,prefix,suffix){if(language in sh_requests){sh_requests[language].push(element);return}sh_requests[language]=[element];var request=sh_getXMLHttpRequest(),url=prefix+"sh_"+language+suffix;request.open("GET",url,!0),request.onreadystatechange=function(){if(request.readyState===4)try{if(!!request.status&&request.status!==200)throw"HTTP error: status "+request.status;eval(request.responseText);var elements=sh_requests[language];for(var i=0;i<elements.length;i++)sh_highlightElement(elements[i],sh_languages[language])}finally{request=null}},request.send(null)}function sh_highlightDocument(a,b){var c=document.getElementsByTagName("pre");for(var d=0;d<c.length;d++){var e=c.item(d),f=e.className.toLowerCase(),g=f.replace(/sh_sourcecode/g,"");g.indexOf("sh_")!=-1&&(g=g.match(/(\bsh_)\w+\b/g)[0]);if(f.indexOf("sh_sourcecode")!=-1)continue;if(g.substr(0,3)==="sh_"){var h=g.substring(3);if(h in sh_languages)sh_highlightElement(e,sh_languages[h]);else if(typeof a=="string"&&typeof b=="string")sh_load(h,e,a,b);else{console.log('Found <pre> element with class="'+g+'", but no such language exists');continue}break}}}(function(a){window.log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments))},a.fn.snippet=function(b,c){typeof b=="object"&&(c=b),typeof b=="string"&&(b=b.toLowerCase());var d={style:"random",showNum:!0,transparent:!1,collapse:!1,menu:!0,showMsg:"Expand Code",hideMsg:"Collapse Code",clipboard:"",startCollapsed:!0,startText:!1,box:"",boxColor:"",boxFill:""},e=["acid","berries-dark","berries-light","bipolar","blacknblue","bright","contrast","darkblue","darkness","desert","dull","easter","emacs","golden","greenlcd","ide-anjuta","ide-codewarrior","ide-devcpp","ide-eclipse","ide-kdev","ide-msvcpp","kwrite","matlab","navy","nedit","neon","night","pablo","peachpuff","print","rand01","the","typical","vampire","vim","vim-dark","whatis","whitengrey","zellner"];return c&&a.extend(d,c),this.each(function(){var c=d.style.toLowerCase();if(d.style=="random"){var f=Math.floor(Math.random()*e.length);c=e[f]}var g=a(this),h=this.nodeName.toLowerCase();if(h!="pre"){var l="Snippet Error: Sorry, Snippet only formats '<pre>' elements. '<"+h+">' elements are currently unsupported.";return console.log(l),!1}if(g.data("orgHtml")==undefined||g.data("orgHtml")==null){var i=g.html();g.data("orgHtml",i)}if(!g.parent().hasClass("snippet-wrap")){if(typeof b!="string"){if(g.attr("class").length>0)var j=' class="'+g.attr("class")+'"';else var j="";if(g.attr("id").length>0)var k=' id="'+g.attr("id")+'"';else var k="";var l="Snippet Error: You must specify a language on inital usage of Snippet. Reference <pre"+j+k+">";return console.log(l),!1}g.addClass("sh_"+b).addClass("snippet-formatted").wrap("<div class='snippet-container' style='"+g.attr("style")+";'><div class='sh_"+c+" snippet-wrap'></div></div>"),g.removeAttr("style"),sh_highlightDocument();if(d.showNum){var m=g.html();m=m.replace(/\n/g,"</li><li>"),m="<ol class='snippet-num'><li>"+m+"</li></ol>";while(m.indexOf("<li></li></ol>")!=-1)m=m.replace("<li></li></ol>","</ol>")}else{var m=g.html();m=m.replace(/\n/g,"</li><li>"),m="<ul class='snippet-no-num'><li>"+m+"</li></ul>";while(m.indexOf("<li></li></ul>")!=-1)m=m.replace("<li></li></ul>","</ul>")}m=m.replace(/\t/g," "),g.html(m);while(g.find("li").eq(0).html()=="")g.find("li").eq(0).remove();g.find("li").each(function(){if(a(this).html().length<2){var b=a(this).html().replace(/\s/g,"");b==""&&(a.browser.opera?a(this).html(" "):a(this).html("<span style='display:none;'> </span>"))}});var n="<pre class='snippet-textonly sh_sourceCode' style='display:none;'>"+g.data("orgHtml")+"</pre>",o="<div class='snippet-menu sh_sourceCode' style='display:none;'><pre><a class='snippet-copy' href='#'>copy</a><a class='snippet-text' href='#'>text</a><a class='snippet-window' href='#'>pop-up</a></pre></div>";g.parent().append(n),g.parent().prepend(o),g.parent().hover(function(){a(this).find(".snippet-menu").fadeIn("fast")},function(){a(this).find(".snippet-menu").fadeOut("fast")});if(d.clipboard!=""&&d.clipboard!=0){var p=g.parent().find("a.snippet-copy");p.show(),p.parents(".snippet-menu").show();var q=g.parents(".snippet-wrap").find(".snippet-textonly").text();ZeroClipboard.setMoviePath(d.clipboard);var r=new ZeroClipboard.Client;r.setText(q),r.glue(p[0],p.parents(".snippet-menu")[0]),r.addEventListener("complete",function(a,b){b.length>500&&(b=b.substr(0,500)+"...\n\n("+(b.length-500)+" characters not shown)"),alert("Copied text to clipboard:\n\n "+b)}),p.parents(".snippet-menu").hide()}else g.parent().find("a.snippet-copy").hide();g.parent().find("a.snippet-text").click(function(){var b=a(this).parents(".snippet-wrap").find(".snippet-formatted"),c=a(this).parents(".snippet-wrap").find(".snippet-textonly");return b.toggle(),c.toggle(),c.is(":visible")?a(this).html("html"):a(this).html("text"),a(this).blur(),!1}),g.parent().find("a.snippet-window").click(function(){var b=a(this).parents(".snippet-wrap").find(".snippet-textonly").html();return snippetPopup(b),a(this).blur(),!1}),d.menu||g.prev(".snippet-menu").find("pre,.snippet-clipboard").hide();if(d.collapse){var s=g.parent().attr("class"),t="<div class='snippet-reveal "+s+"'><pre class='sh_sourceCode'><a href='#' class='snippet-toggle'>"+d.showMsg+"</a></pre></div>",u="<div class='sh_sourceCode snippet-hide'><pre><a href='#' class='snippet-revealed snippet-toggle'>"+d.hideMsg+"</a></pre></div>";g.parents(".snippet-container").append(t),g.parent().append(u);var v=g.parents(".snippet-container");d.startCollapsed?(v.find(".snippet-reveal").show(),v.find(".snippet-wrap").eq(0).hide()):(v.find(".snippet-reveal").hide(),v.find(".snippet-wrap").eq(0).show()),v.find("a.snippet-toggle").click(function(){return v.find(".snippet-wrap").toggle(),!1})}if(d.transparent){var w={"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-reveal pre").css(w)}d.startText&&(g.hide(),g.next(".snippet-textonly").show(),g.parent().find(".snippet-text").html("html"));if(d.box!=""){var x="<span class='box-sp'> </span>",y=d.box.split(",");for(var z=0;z<y.length;z++){var A=y[z];if(A.indexOf("-")==-1)A=parseFloat(A)-1,g.find("li").eq(A).addClass("box").prepend(x);else{var B=parseFloat(A.split("-")[0])-1,C=parseFloat(A.split("-")[1])-1;if(B<C){g.find("li").eq(B).addClass("box box-top").prepend(x),g.find("li").eq(C).addClass("box box-bot").prepend(x);for(var D=B+1;D<C;D++)g.find("li").eq(D).addClass("box box-mid").prepend(x)}else B==C&&g.find("li").eq(B).addClass("box").prepend(x)}}d.boxColor!=""&&g.find("li.box").css("border-color",d.boxColor),d.boxFill!=""&&g.find("li.box, li.box-top, li.box-mid, li.box-bot").addClass("box-bg").css("background-color",d.boxFill),a.browser.webkit&&(g.find(".snippet-num li.box").css("margin-left","-3.3em"),g.find(".snippet-num li .box-sp").css("width","21px"))}g.parents(".snippet-container").find("a").addClass("sh_url")}else{g.parent().attr("class","sh_"+c+" snippet-wrap"),g.parents(".snippet-container").find(".snippet-reveal").attr("class","sh_"+c+" snippet-wrap snippet-reveal"),g.find("li.box, li.box-top, li.box-mid, li.box-bot").removeAttr("style").removeAttr("class"),g.find("li .box-sp").remove();if(d.transparent){var w={"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-hide pre").css(w)}else{var w={"background-color":"","box-shadow":"","-moz-box-shadow":"","-webkit-box-shadow":""};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-reveal pre").css(w)}if(d.showNum){var E=g.find("li").eq(0).parent();if(E.hasClass("snippet-no-num")){E.wrap("<ol class='snippet-num'></ol>");var F=g.find("li").eq(0);F.unwrap()}}else{var E=g.find("li").eq(0).parent();if(E.hasClass("snippet-num")){E.wrap("<ul class='snippet-no-num'></ul>");var F=g.find("li").eq(0);F.unwrap()}}if(d.box!=""){var x="<span class='box-sp'> </span>",y=d.box.split(",");for(var z=0;z<y.length;z++){var A=y[z];if(A.indexOf("-")==-1)A=parseFloat(A)-1,g.find("li").eq(A).addClass("box").prepend(x);else{var B=parseFloat(A.split("-")[0])-1,C=parseFloat(A.split("-")[1])-1;if(B<C){g.find("li").eq(B).addClass("box box-top").prepend(x),g.find("li").eq(C).addClass("box box-bot").prepend(x);for(var D=B+1;D<C;D++)g.find("li").eq(D).addClass("box box-mid").prepend(x)}else B==C&&g.find("li").eq(B).addClass("box").prepend(x)}}d.boxColor!=""&&g.find("li.box").css("border-color",d.boxColor),d.boxFill!=""&&g.find("li.box").addClass("box-bg").css("background-color",d.boxFill),a.browser.webkit&&(g.find(".snippet-num li.box").css("margin-left","-3.3em"),g.find(".snippet-num li .box-sp").css("width","21px"))}sh_highlightDocument(),d.menu?g.prev(".snippet-menu").find("pre,.snippet-clipboard").show():g.prev(".snippet-menu").find("pre,.snippet-clipboard").hide()}})}})(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return typeof a=="string"&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){var b=this.className.split(/\s+/),c=-1;for(var d=0;d<b.length;d++)b[d]==a&&(c=d,d=b.length);return c>-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};while(a&&a!=b)c.left+=a.offsetLeft,c.top+=a.offsetTop,a=a.offsetParent;return c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1),typeof b=="string"?b=ZeroClipboard.$(b):typeof b=="undefined"&&(b=document.getElementsByTagName("body")[0]);var e=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div"),this.div.className="snippet-clipboard";var f=this.div.style;f.position="absolute",f.left=""+e.left+"px",f.top=""+e.top+"px",f.width=""+e.width+"px",f.height=""+e.height+"px",f.zIndex=d;if(typeof c=="object")for(addedStyle in c)f[addedStyle]=c[addedStyle];b.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>'}else c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+d+'" wmode="transparent" />';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide());if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100),this.ready=!0;return}this.ready=!0;try{this.movie.setText(this.clipText)}catch(d){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(d){}break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var e=0,f=this.handlers[a].length;e<f;e++){var g=this.handlers[a][e];typeof g=="function"?g(this,b):typeof g=="object"&&g.length==2?g[0][g[1]](this,b):typeof g=="string"&&window[g](this,b)}}},this.sh_languages||(this.sh_languages={});var sh_requests={};this.sh_languages||(this.sh_languages={}),sh_languages.c=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.cpp=[[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.csharp=[[[/\b(?:using)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))(?:[FfDdMmUulL]+)?\b/g,"sh_number",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|event|new|struct|as|explicit|null|switch|base|extern|this|false|operator|throw|break|finally|out|true|fixed|override|try|case|params|typeof|catch|for|private|foreach|protected|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|continue|in|return|virtual|default|interface|sealed|volatile|delegate|internal|do|is|sizeof|while|lock|stackalloc|else|static|enum|namespace|get|partial|set|value|where|yield)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.css=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(?:\.|#)[A-Za-z0-9_]+/g,"sh_selector",-1],[/\{/g,"sh_cbracket",10,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\}/g,"sh_cbracket",-2],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/[A-Za-z0-9_-]+[ \t]*:/g,"sh_property",-1],[/[.%A-Za-z0-9_-]+/g,"sh_value",-1],[/#(?:[A-Za-z0-9_]+)/g,"sh_string",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.flex=[[[/^%\{/g,"sh_preproc",1,1],[/^%[sx]/g,"sh_preproc",16,1],[/^%option/g,"sh_preproc",17,1],[/^%(?:array|pointer|[aceknopr])/g,"sh_preproc",-1],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_preproc",19,1],[/^%%/g,"sh_preproc",20,1]],[[/^%\}/g,"sh_preproc",-2],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",6]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",12],[/"/g,"sh_string",13],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_function",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_keyword",-1],[/"/g,"sh_string",18],[/=/g,"sh_symbol",-1]],[[/$/g,null,-2],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/"/g,"sh_string",13],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/^%%/g,"sh_preproc",21,1],[/<[A-Za-z_][A-Za-z0-9_-]*>/g,"sh_function",-1],[/"/g,"sh_string",13],[/\\./g,"sh_preproc",-1],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/\/\*/g,"sh_comment",22],[/\{/g,"sh_cbracket",23,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/\*\//g,"sh_comment",-2],[/\/\*/g,"sh_comment",22]],[[/\}/g,"sh_cbracket",-2],[/\{/g,"sh_cbracket",23,1],[/\$./g,"sh_variable",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.html=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",5,1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]],this.sh_languages||(this.sh_languages={}),sh_languages.java=[[[/\b(?:import|package)\b/g,"sh_preproc",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/(\b(?:class|interface))([ \t]+)([$A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|assert|break|case|catch|class|const|continue|default|do|else|extends|false|final|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|static|strictfp|super|switch|synchronized|throw|throws|true|this|transient|try|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.javascript=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.javascript_dom=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/\b(?:applicationCache|closed|Components|content|controllers|crypto|defaultStatus|dialogArguments|directories|document|frameElement|frames|fullScreen|globalStorage|history|innerHeight|innerWidth|length|location|locationbar|menubar|name|navigator|opener|outerHeight|outerWidth|pageXOffset|pageYOffset|parent|personalbar|pkcs11|returnValue|screen|availTop|availLeft|availHeight|availWidth|colorDepth|height|left|pixelDepth|top|width|screenX|screenY|scrollbars|scrollMaxX|scrollMaxY|scrollX|scrollY|self|sessionStorage|sidebar|status|statusbar|toolbar|top|window)\b/g,"sh_predef_var",-1],[/\b(?:alert|addEventListener|atob|back|blur|btoa|captureEvents|clearInterval|clearTimeout|close|confirm|dump|escape|find|focus|forward|getAttention|getComputedStyle|getSelection|home|moveBy|moveTo|open|openDialog|postMessage|print|prompt|releaseEvents|removeEventListener|resizeBy|resizeTo|scroll|scrollBy|scrollByLines|scrollByPages|scrollTo|setInterval|setTimeout|showModalDialog|sizeToContent|stop|unescape|updateCommands|onabort|onbeforeunload|onblur|onchange|onclick|onclose|oncontextmenu|ondragdrop|onerror|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onpaint|onreset|onresize|onscroll|onselect|onsubmit|onunload)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.perl=[[[/\b(?:import)\b/g,"sh_preproc",-1],[/(s)(\{(?:\\\}|[^}])*\}\{(?:\\\}|[^}])*\})([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\((?:\\\)|[^)])*\)\((?:\\\)|[^)])*\))([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\[(?:\\\]|[^\]])*\]\[(?:\\\]|[^\]])*\])([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(<.*><.*>)([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(q(?:q?))(\{(?:\\\}|[^}])*\})/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\((?:\\\)|[^)])*\))/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\[(?:\\\]|[^\]])*\])/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(<.*>)/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))([^A-Za-z0-9 \t])(.*\2)/g,["sh_keyword","sh_string","sh_string"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2.*\2)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_keyword"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2[ \t]*)([^A-Za-z0-9 \t])(.*\4)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_regexp","sh_regexp","sh_keyword"],-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/(?:m|qr)(?=\{)/g,"sh_keyword",2],[/(?:m|qr)(?=#)/g,"sh_keyword",4],[/(?:m|qr)(?=\|)/g,"sh_keyword",6],[/(?:m|qr)(?=@)/g,"sh_keyword",8],[/(?:m|qr)(?=<)/g,"sh_keyword",10],[/(?:m|qr)(?=\[)/g,"sh_keyword",12],[/(?:m|qr)(?=\\)/g,"sh_keyword",14],[/(?:m|qr)(?=\/)/g,"sh_keyword",16],[/"/g,"sh_string",18],[/'/g,"sh_string",19],[/</g,"sh_string",20],[/\/[^\n]*\//g,"sh_string",-1],[/\b(?:chomp|chop|chr|crypt|hex|i|index|lc|lcfirst|length|oct|ord|pack|q|qq|reverse|rindex|sprintf|substr|tr|uc|ucfirst|m|s|g|qw|abs|atan2|cos|exp|hex|int|log|oct|rand|sin|sqrt|srand|my|local|our|delete|each|exists|keys|values|pack|read|syscall|sysread|syswrite|unpack|vec|undef|unless|return|length|grep|sort|caller|continue|dump|eval|exit|goto|last|next|redo|sub|wantarray|pop|push|shift|splice|unshift|split|switch|join|defined|foreach|last|chop|chomp|bless|dbmclose|dbmopen|ref|tie|tied|untie|while|next|map|eq|die|cmp|lc|uc|and|do|if|else|elsif|for|use|require|package|import|chdir|chmod|chown|chroot|fcntl|glob|ioctl|link|lstat|mkdir|open|opendir|readlink|rename|rmdir|stat|symlink|umask|unlink|utime|binmode|close|closedir|dbmclose|dbmopen|die|eof|fileno|flock|format|getc|print|printf|read|readdir|rewinddir|seek|seekdir|select|syscall|sysread|sysseek|syswrite|tell|telldir|truncate|warn|write|alarm|exec|fork|getpgrp|getppid|getpriority|kill|pipe|qx|setpgrp|setpriority|sleep|system|times|x|wait|waitpid)\b/g,"sh_keyword",-1],[/^\=(?:head1|head2|item)/g,"sh_comment",21],[/(?:\$[#]?|@|%)[\/A-Za-z0-9_]+/g,"sh_variable",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\{/g,"sh_regexp",3]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\{|\\\}|\}/g,"sh_regexp",-3]],[[/#/g,"sh_regexp",5]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\#|#/g,"sh_regexp",-3]],[[/\|/g,"sh_regexp",7]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\||\|/g,"sh_regexp",-3]],[[/@/g,"sh_regexp",9]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\@|@/g,"sh_regexp",-3]],[[/</g,"sh_regexp",11]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\<|\\>|>/g,"sh_regexp",-3]],[[/\[/g,"sh_regexp",13]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\]|\]/g,"sh_regexp",-3]],[[/\\/g,"sh_regexp",15]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\\|\\/g,"sh_regexp",-3]],[[/\//g,"sh_regexp",17]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\/|\//g,"sh_regexp",-3]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/\=cut/g,"sh_comment",-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.php=[[[/\b(?:include|include_once|require|require_once)\b/g,"sh_preproc",-1],[/\/\//g,"sh_comment",1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/\b(?:and|or|xor|__FILE__|exception|php_user_filter|__LINE__|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|each|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|isset|list|new|old_function|print|return|static|switch|unset|use|var|while|__FUNCTION__|__CLASS__|__METHOD__)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",4],[/\/\//g,"sh_comment",1],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(?:\$[#]?|@|%)[A-Za-z0-9_]+/g,"sh_variable",-1],[/<\?php|~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",7]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.python=[[[/\b(?:import|from)\b/g,"sh_preproc",-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/\b(?:and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|global|if|in|is|lambda|not|or|pass|print|raise|return|try|while)\b/g,"sh_keyword",-1],[/^(?:[\s]*'{3})/g,"sh_comment",2],[/^(?:[\s]*\"{3})/g,"sh_comment",3],[/^(?:[\s]*'(?:[^\\']|\\.)*'[\s]*|[\s]*\"(?:[^\\\"]|\\.)*\"[\s]*)$/g,"sh_comment",-1],[/(?:[\s]*'{3})/g,"sh_string",4],[/(?:[\s]*\"{3})/g,"sh_string",5],[/"/g,"sh_string",6],[/'/g,"sh_string",7],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\||\{|\}/g,"sh_symbol",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/(?:'{3})/g,"sh_comment",-2]],[[/(?:\"{3})/g,"sh_comment",-2]],[[/(?:'{3})/g,"sh_string",-2]],[[/(?:\"{3})/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.ruby=[[[/\b(?:require)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/</g,"sh_string",3],[/\/[^\n]*\//g,"sh_regexp",-1],[/(%r)(\{(?:\\\}|#\{[A-Za-z0-9]+\}|[^}])*\})/g,["sh_symbol","sh_regexp"],-1],[/\b(?:alias|begin|BEGIN|break|case|defined|do|else|elsif|end|END|ensure|for|if|in|include|loop|next|raise|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|false|nil|self|true|__FILE__|__LINE__|and|not|or|def|class|module|catch|fail|load|throw)\b/g,"sh_keyword",-1],[/(?:^\=begin)/g,"sh_comment",4],[/(?:\$[#]?|@@|@)(?:[A-Za-z0-9_]+|'|\"|\/)/g,"sh_type",-1],[/[A-Za-z0-9]+(?:\?|!)/g,"sh_normal",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/(#)(\{)/g,["sh_symbol","sh_cbracket"],-1],[/#/g,"sh_comment",5],[/\{|\}/g,"sh_cbracket",-1]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/^(?:\=end)/g,"sh_comment",-2]],[[/$/g,null,-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.sql=[[[/\b(?:VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b/gi,"sh_type",-1],[/\b(?:ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT|BETWEEN|BINARY|BOTH|BY|BOOLEAN|CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE|DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT|ENCLOSED|ESCAPED|EXISTS|EXPLAIN|FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM|GROUP|GRANT|HAVING|IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF|JOIN|KEYS|KILL|KEY|LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE|MODIFY|NATURAL|NOT|NULL|NEXTVAL|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON|PROCEDURE|PROCEDURAL|PRIMARY|READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT|SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET|TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED|UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW|WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b/gi,"sh_keyword",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/`/g,"sh_string",3],[/#/g,"sh_comment",4],[/\/\/\//g,"sh_comment",5],[/\/\//g,"sh_comment",4],[/\/\*\*/g,"sh_comment",11],[/\/\*/g,"sh_comment",12],[/--/g,"sh_comment",4],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/`/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",9]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.url=[[{regex:/(?:<?)[A-Za-z0-9_\.\/\-_]+@[A-Za-z0-9_\.\/\-_]+(?:>?)/g,style:"sh_url"},{regex:/(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_]+(?:>?)/g,style:"sh_url"}]],this.sh_languages||(this.sh_languages={}),sh_languages.xml=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]],$("pre").snippet("javascript",{style:"typical",showNum:!1})
\ No newline at end of file
+++ /dev/null
-function snippetPopup(a){top.consoleRef=window.open("","myconsole","width=600,height=300,left=50,top=50,menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable=1"),top.consoleRef.document.writeln("<html><head><title>Snippet :: Code View :: "+location.href+"</title></head>"+'<body bgcolor=white onLoad="self.focus()">'+"<pre>"+a+"</pre>"+"</body></html>"),top.consoleRef.document.close()}function sh_isEmailAddress(a){return/^mailto:/.test(a)?!1:a.indexOf("@")!==-1}function sh_setHref(a,b,c){var d=c.substring(a[b-2].pos,a[b-1].pos);d.length>=2&&d.charAt(0)==="<"&&d.charAt(d.length-1)===">"&&(d=d.substr(1,d.length-2)),sh_isEmailAddress(d)&&(d="mailto:"+d),a[b-2].node.href=d}function sh_konquerorExec(a){var b=[""];return b.index=a.length,b.input=a,b}function sh_highlightString(a,b){if(/Konqueror/.test(navigator.userAgent)&&!b.konquered){for(var c=0;c<b.length;c++)for(var d=0;d<b[c].length;d++){var e=b[c][d][0];e.source==="$"&&(e.exec=sh_konquerorExec)}b.konquered=!0}var f=document.createElement("a"),g=document.createElement("span"),h=[],i=0,j=[],k=0,l=null,m=function(b,c){var d=b.length;if(d===0)return;if(!c){var e=j.length;if(e!==0){var m=j[e-1];m[3]||(c=m[1])}}if(l!==c){l&&(h[i++]={pos:k},l==="sh_url"&&sh_setHref(h,i,a));if(c){var n;c==="sh_url"?n=f.cloneNode(!1):n=g.cloneNode(!1),n.className=c,h[i++]={node:n,pos:k}}}k+=d,l=c},n=/\r\n|\r|\n/g;n.lastIndex=0;var o=a.length;while(k<o){var p=k,q,r,s=n.exec(a);s===null?(q=o,r=o):(q=s.index,r=n.lastIndex);var t=a.substring(p,q),u=[];for(;;){var v=k-p,w,x=j.length;x===0?w=0:w=j[x-1][2];var y=b[w],z=y.length,A=u[w];A||(A=u[w]=[]);var B=null,C=-1;for(var D=0;D<z;D++){var E;if(D<A.length&&(A[D]===null||v<=A[D].index))E=A[D];else{var F=y[D][0];F.lastIndex=v,E=F.exec(t),A[D]=E}if(E!==null&&(B===null||E.index<B.index)){B=E,C=D;if(E.index===v)break}}if(B===null){m(t.substring(v),null);break}B.index>v&&m(t.substring(v,B.index),null);var G=y[C],H=G[1],I;if(H instanceof Array)for(var J=0;J<H.length;J++)I=B[J+1],m(I,H[J]);else I=B[0],m(I,H);switch(G[2]){case-1:break;case-2:j.pop();break;case-3:j.length=0;break;default:j.push(G)}}l&&(h[i++]={pos:k},l==="sh_url"&&sh_setHref(h,i,a),l=null),k=r}return h}function sh_getClasses(a){var b=[],c=a.className;if(c&&c.length>0){var d=c.split(" ");for(var e=0;e<d.length;e++)d[e].length>0&&b.push(d[e])}return b}function sh_addClass(a,b){var c=sh_getClasses(a);for(var d=0;d<c.length;d++)if(b.toLowerCase()===c[d].toLowerCase())return;c.push(b),a.className=c.join(" ")}function sh_extractTagsFromNodeList(a,b){var c=a.length;for(var d=0;d<c;d++){var e=a.item(d);switch(e.nodeType){case 1:if(e.nodeName.toLowerCase()==="br"){var f;/MSIE/.test(navigator.userAgent)?f="\r":f="\n",b.text.push(f),b.pos++}else b.tags.push({node:e.cloneNode(!1),pos:b.pos}),sh_extractTagsFromNodeList(e.childNodes,b),b.tags.push({pos:b.pos});break;case 3:case 4:b.text.push(e.data),b.pos+=e.length}}}function sh_extractTags(a,b){var c={};return c.text=[],c.tags=b,c.pos=0,sh_extractTagsFromNodeList(a.childNodes,c),c.text.join("")}function sh_mergeTags(a,b){var c=a.length;if(c===0)return b;var d=b.length;if(d===0)return a;var e=[],f=0,g=0;while(f<c&&g<d){var h=a[f],i=b[g];h.pos<=i.pos?(e.push(h),f++):(e.push(i),b[g+1].pos<=h.pos?(g++,e.push(b[g]),g++):(e.push({pos:h.pos}),b[g]={node:i.node.cloneNode(!1),pos:h.pos}))}while(f<c)e.push(a[f]),f++;while(g<d)e.push(b[g]),g++;return e}function sh_insertTags(a,b){var c=document,d=document.createDocumentFragment(),e=0,f=a.length,g=0,h=b.length,i=d;while(g<h||e<f){var j,k;e<f?(j=a[e],k=j.pos):k=h;if(k<=g){if(j.node){var l=j.node;i.appendChild(l),i=l}else i=i.parentNode;e++}else i.appendChild(c.createTextNode(b.substring(g,k))),g=k}return d}function sh_highlightElement(a,b){sh_addClass(a,"sh_sourceCode");var c=[],d=sh_extractTags(a,c),e=sh_highlightString(d,b),f=sh_mergeTags(c,e),g=sh_insertTags(f,d);while(a.hasChildNodes())a.removeChild(a.firstChild);a.appendChild(g)}function sh_getXMLHttpRequest(){if(window.ActiveXObject)return new ActiveXObject("Msxml2.XMLHTTP");if(window.XMLHttpRequest)return new XMLHttpRequest;throw"No XMLHttpRequest implementation available"}function sh_load(language,element,prefix,suffix){if(language in sh_requests){sh_requests[language].push(element);return}sh_requests[language]=[element];var request=sh_getXMLHttpRequest(),url=prefix+"sh_"+language+suffix;request.open("GET",url,!0),request.onreadystatechange=function(){if(request.readyState===4)try{if(!!request.status&&request.status!==200)throw"HTTP error: status "+request.status;eval(request.responseText);var elements=sh_requests[language];for(var i=0;i<elements.length;i++)sh_highlightElement(elements[i],sh_languages[language])}finally{request=null}},request.send(null)}function sh_highlightDocument(a,b){var c=document.getElementsByTagName("pre");for(var d=0;d<c.length;d++){var e=c.item(d),f=e.className.toLowerCase(),g=f.replace(/sh_sourcecode/g,"");g.indexOf("sh_")!=-1&&(g=g.match(/(\bsh_)\w+\b/g)[0]);if(f.indexOf("sh_sourcecode")!=-1)continue;if(g.substr(0,3)==="sh_"){var h=g.substring(3);if(h in sh_languages)sh_highlightElement(e,sh_languages[h]);else if(typeof a=="string"&&typeof b=="string")sh_load(h,e,a,b);else{console.log('Found <pre> element with class="'+g+'", but no such language exists');continue}break}}}(function(a,b){function r(a){this._d=a}function s(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function t(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j,k;return f&&e&&(g[c]=+e),h=(g.ms||g.milliseconds||0)+(g.s||g.seconds||0)*1e3+(g.m||g.minutes||0)*6e4+(g.h||g.hours||0)*36e5,i=(g.d||g.days||0)+(g.w||g.weeks||0)*7,j=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&b.setDate(b.getDate()+i*d),j&&(k=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+j*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),k))),b}function u(a){return Object.prototype.toString.call(a)==="[object Array]"}function v(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function w(b,d){function u(d){var e,j;switch(d){case"M":return f+1;case"Mo":return f+1+q(f+1);case"MM":return s(f+1,2);case"MMM":return c.monthsShort[f];case"MMMM":return c.months[f];case"D":return g;case"Do":return g+q(g);case"DD":return s(g,2);case"DDD":return e=new a(h,f,g),j=new a(h,0,1),~~((e-j)/864e5+1.5);case"DDDo":return e=u("DDD"),e+q(e);case"DDDD":return s(u("DDD"),3);case"d":return i;case"do":return i+q(i);case"ddd":return c.weekdaysShort[i];case"dddd":return c.weekdays[i];case"w":return e=new a(h,f,g-i+5),j=new a(e.getFullYear(),0,4),~~((e-j)/864e5/7+1.5);case"wo":return e=u("w"),e+q(e);case"ww":return s(u("w"),2);case"YY":return s(h%100,2);case"YYYY":return h;case"a":return m>11?t.pm:t.am;case"A":return m>11?t.PM:t.AM;case"H":return m;case"HH":return s(m,2);case"h":return m%12||12;case"hh":return s(m%12||12,2);case"m":return n;case"mm":return s(n,2);case"s":return o;case"ss":return s(o,2);case"zz":case"z":return(b.toString().match(l)||[""])[0].replace(k,"");case"Z":return(p>0?"+":"-")+s(~~(Math.abs(p)/60),2)+":"+s(~~(Math.abs(p)%60),2);case"ZZ":return(p>0?"+":"-")+s(~~(10*Math.abs(p)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return w(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=new r(b),f=e.month(),g=e.date(),h=e.year(),i=e.day(),m=e.hours(),n=e.minutes(),o=e.seconds(),p=-e.zone(),q=c.ordinal,t=c.meridiem;return d.replace(j,u)}function x(b,d){function p(a,b){var d;switch(a){case"M":case"MM":e[1]=~~b-1;break;case"MMM":case"MMMM":for(d=0;d<12;d++)if(c.monthsParse[d].test(b)){e[1]=d;break}break;case"D":case"DD":case"DDD":case"DDDD":e[2]=~~b;break;case"YY":b=~~b,e[0]=b+(b>70?1900:2e3);break;case"YYYY":e[0]=~~Math.abs(b);break;case"a":case"A":l=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"Z":case"ZZ":h=!0,d=(b||"").match(o),d&&d[1]&&(f=~~d[1]),d&&d[2]&&(g=~~d[2]),d&&d[0]==="+"&&(f=-f,g=-g)}}var e=[0,0,1,0,0,0,0],f=0,g=0,h=!1,i=b.match(n),j=d.match(m),k,l;for(k=0;k<j.length;k++)p(j[k],i[k]);return l&&e[3]<12&&(e[3]+=12),l===!1&&e[3]===12&&(e[3]=0),e[3]+=f,e[4]+=g,h?new a(a.UTC.apply({},e)):v(e)}function y(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function z(a,b){var c,d=a.match(n),e=[],f=99,g,h,i;for(g=0;g<b.length;g++)h=x(a,b[g]),i=y(d,w(h,b[g]).match(n)),i<f&&(f=i,c=h);return c}function A(a,b,d){var e=c.relativeTime[a];return typeof e=="function"?e(b||1,!!d,a):e.replace(/%d/i,b||1)}function B(a,b){var c=d(Math.abs(a)/1e3),e=d(c/60),f=d(e/60),g=d(f/24),h=d(g/365),i=c<45&&["s",c]||e===1&&["m"]||e<45&&["mm",e]||f===1&&["h"]||f<22&&["hh",f]||g===1&&["d"]||g<=25&&["dd",g]||g<=45&&["M"]||g<345&&["MM",d(g/30)]||h===1&&["y"]||["yy",h];return i[2]=b,A.apply({},i)}function C(a,b){c.fn[a]=function(a){return a!=null?(this._d["set"+b](a),this):this._d["get"+b]()}}var c,d=Math.round,e={},f=typeof module!="undefined",g="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),h,i=/^\/?Date\((\d+)/i,j=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,k=/[^A-Z]/g,l=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,m=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,n=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,o=/([\+\-]|\d\d)/gi,p="1.4.0",q="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|");c=function(c,d){if(c===null)return null;var e,f;return c&&c._d instanceof a?e=new a(+c._d):d?u(d)?e=z(c,d):e=x(c,d):(f=i.exec(c),e=c===b?new a:f?new a(+f[1]):c instanceof a?c:u(c)?v(c):new a(c)),new r(e)},c.version=p,c.lang=function(a,b){var d,h,i,j=[];if(b){for(d=0;d<12;d++)j[d]=new RegExp("^"+b.months[d]+"|^"+b.monthsShort[d].replace(".",""),"i");b.monthsParse=b.monthsParse||j,e[a]=b}if(e[a])for(d=0;d<g.length;d++)h=g[d],c[h]=e[a][h]||c[h];else f&&(i=require("./lang/"+a),c.lang(a,i))},c.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=r.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},"native":function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return w(this._d,a)},add:function(a,b){return this._d=t(this._d,a,1,b),this},subtract:function(a,b){return this._d=t(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+j/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=B(d,b);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=c.calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<c([this.year()]).zone()||this.zone()<c([this.year(),5]).zone()},day:function(a){var b=this._d.getDay();return a==null?b:this.add({d:a-b})},sod:function(){return this.clone().hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})}};for(h=0;h<q.length;h++)C(q[h].toLowerCase(),q[h]);C("year","FullYear"),c.fn.zone=function(){return this._d.getTimezoneOffset()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c),typeof define=="function"&&define.amd&&define("moment",[],function(){return c})})(Date),function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),function(a){window.log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments))},a.fn.snippet=function(b,c){typeof b=="object"&&(c=b),typeof b=="string"&&(b=b.toLowerCase());var d={style:"random",showNum:!0,transparent:!1,collapse:!1,menu:!0,showMsg:"Expand Code",hideMsg:"Collapse Code",clipboard:"",startCollapsed:!0,startText:!1,box:"",boxColor:"",boxFill:""},e=["acid","berries-dark","berries-light","bipolar","blacknblue","bright","contrast","darkblue","darkness","desert","dull","easter","emacs","golden","greenlcd","ide-anjuta","ide-codewarrior","ide-devcpp","ide-eclipse","ide-kdev","ide-msvcpp","kwrite","matlab","navy","nedit","neon","night","pablo","peachpuff","print","rand01","the","typical","vampire","vim","vim-dark","whatis","whitengrey","zellner"];return c&&a.extend(d,c),this.each(function(){var c=d.style.toLowerCase();if(d.style=="random"){var f=Math.floor(Math.random()*e.length);c=e[f]}var g=a(this),h=this.nodeName.toLowerCase();if(h!="pre"){var l="Snippet Error: Sorry, Snippet only formats '<pre>' elements. '<"+h+">' elements are currently unsupported.";return console.log(l),!1}if(g.data("orgHtml")==undefined||g.data("orgHtml")==null){var i=g.html();g.data("orgHtml",i)}if(!g.parent().hasClass("snippet-wrap")){if(typeof b!="string"){if(g.attr("class").length>0)var j=' class="'+g.attr("class")+'"';else var j="";if(g.attr("id").length>0)var k=' id="'+g.attr("id")+'"';else var k="";var l="Snippet Error: You must specify a language on inital usage of Snippet. Reference <pre"+j+k+">";return console.log(l),!1}g.addClass("sh_"+b).addClass("snippet-formatted").wrap("<div class='snippet-container' style='"+g.attr("style")+";'><div class='sh_"+c+" snippet-wrap'></div></div>"),g.removeAttr("style"),sh_highlightDocument();if(d.showNum){var m=g.html();m=m.replace(/\n/g,"</li><li>"),m="<ol class='snippet-num'><li>"+m+"</li></ol>";while(m.indexOf("<li></li></ol>")!=-1)m=m.replace("<li></li></ol>","</ol>")}else{var m=g.html();m=m.replace(/\n/g,"</li><li>"),m="<ul class='snippet-no-num'><li>"+m+"</li></ul>";while(m.indexOf("<li></li></ul>")!=-1)m=m.replace("<li></li></ul>","</ul>")}m=m.replace(/\t/g," "),g.html(m);while(g.find("li").eq(0).html()=="")g.find("li").eq(0).remove();g.find("li").each(function(){if(a(this).html().length<2){var b=a(this).html().replace(/\s/g,"");b==""&&(a.browser.opera?a(this).html(" "):a(this).html("<span style='display:none;'> </span>"))}});var n="<pre class='snippet-textonly sh_sourceCode' style='display:none;'>"+g.data("orgHtml")+"</pre>",o="<div class='snippet-menu sh_sourceCode' style='display:none;'><pre><a class='snippet-copy' href='#'>copy</a><a class='snippet-text' href='#'>text</a><a class='snippet-window' href='#'>pop-up</a></pre></div>";g.parent().append(n),g.parent().prepend(o),g.parent().hover(function(){a(this).find(".snippet-menu").fadeIn("fast")},function(){a(this).find(".snippet-menu").fadeOut("fast")});if(d.clipboard!=""&&d.clipboard!=0){var p=g.parent().find("a.snippet-copy");p.show(),p.parents(".snippet-menu").show();var q=g.parents(".snippet-wrap").find(".snippet-textonly").text();ZeroClipboard.setMoviePath(d.clipboard);var r=new ZeroClipboard.Client;r.setText(q),r.glue(p[0],p.parents(".snippet-menu")[0]),r.addEventListener("complete",function(a,b){b.length>500&&(b=b.substr(0,500)+"...\n\n("+(b.length-500)+" characters not shown)"),alert("Copied text to clipboard:\n\n "+b)}),p.parents(".snippet-menu").hide()}else g.parent().find("a.snippet-copy").hide();g.parent().find("a.snippet-text").click(function(){var b=a(this).parents(".snippet-wrap").find(".snippet-formatted"),c=a(this).parents(".snippet-wrap").find(".snippet-textonly");return b.toggle(),c.toggle(),c.is(":visible")?a(this).html("html"):a(this).html("text"),a(this).blur(),!1}),g.parent().find("a.snippet-window").click(function(){var b=a(this).parents(".snippet-wrap").find(".snippet-textonly").html();return snippetPopup(b),a(this).blur(),!1}),d.menu||g.prev(".snippet-menu").find("pre,.snippet-clipboard").hide();if(d.collapse){var s=g.parent().attr("class"),t="<div class='snippet-reveal "+s+"'><pre class='sh_sourceCode'><a href='#' class='snippet-toggle'>"+d.showMsg+"</a></pre></div>",u="<div class='sh_sourceCode snippet-hide'><pre><a href='#' class='snippet-revealed snippet-toggle'>"+d.hideMsg+"</a></pre></div>";g.parents(".snippet-container").append(t),g.parent().append(u);var v=g.parents(".snippet-container");d.startCollapsed?(v.find(".snippet-reveal").show(),v.find(".snippet-wrap").eq(0).hide()):(v.find(".snippet-reveal").hide(),v.find(".snippet-wrap").eq(0).show()),v.find("a.snippet-toggle").click(function(){return v.find(".snippet-wrap").toggle(),!1})}if(d.transparent){var w={"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-reveal pre").css(w)}d.startText&&(g.hide(),g.next(".snippet-textonly").show(),g.parent().find(".snippet-text").html("html"));if(d.box!=""){var x="<span class='box-sp'> </span>",y=d.box.split(",");for(var z=0;z<y.length;z++){var A=y[z];if(A.indexOf("-")==-1)A=parseFloat(A)-1,g.find("li").eq(A).addClass("box").prepend(x);else{var B=parseFloat(A.split("-")[0])-1,C=parseFloat(A.split("-")[1])-1;if(B<C){g.find("li").eq(B).addClass("box box-top").prepend(x),g.find("li").eq(C).addClass("box box-bot").prepend(x);for(var D=B+1;D<C;D++)g.find("li").eq(D).addClass("box box-mid").prepend(x)}else B==C&&g.find("li").eq(B).addClass("box").prepend(x)}}d.boxColor!=""&&g.find("li.box").css("border-color",d.boxColor),d.boxFill!=""&&g.find("li.box, li.box-top, li.box-mid, li.box-bot").addClass("box-bg").css("background-color",d.boxFill),a.browser.webkit&&(g.find(".snippet-num li.box").css("margin-left","-3.3em"),g.find(".snippet-num li .box-sp").css("width","21px"))}g.parents(".snippet-container").find("a").addClass("sh_url")}else{g.parent().attr("class","sh_"+c+" snippet-wrap"),g.parents(".snippet-container").find(".snippet-reveal").attr("class","sh_"+c+" snippet-wrap snippet-reveal"),g.find("li.box, li.box-top, li.box-mid, li.box-bot").removeAttr("style").removeAttr("class"),g.find("li .box-sp").remove();if(d.transparent){var w={"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-hide pre").css(w)}else{var w={"background-color":"","box-shadow":"","-moz-box-shadow":"","-webkit-box-shadow":""};g.css(w),g.next(".snippet-textonly").css(w),g.parents(".snippet-container").find(".snippet-reveal pre").css(w)}if(d.showNum){var E=g.find("li").eq(0).parent();if(E.hasClass("snippet-no-num")){E.wrap("<ol class='snippet-num'></ol>");var F=g.find("li").eq(0);F.unwrap()}}else{var E=g.find("li").eq(0).parent();if(E.hasClass("snippet-num")){E.wrap("<ul class='snippet-no-num'></ul>");var F=g.find("li").eq(0);F.unwrap()}}if(d.box!=""){var x="<span class='box-sp'> </span>",y=d.box.split(",");for(var z=0;z<y.length;z++){var A=y[z];if(A.indexOf("-")==-1)A=parseFloat(A)-1,g.find("li").eq(A).addClass("box").prepend(x);else{var B=parseFloat(A.split("-")[0])-1,C=parseFloat(A.split("-")[1])-1;if(B<C){g.find("li").eq(B).addClass("box box-top").prepend(x),g.find("li").eq(C).addClass("box box-bot").prepend(x);for(var D=B+1;D<C;D++)g.find("li").eq(D).addClass("box box-mid").prepend(x)}else B==C&&g.find("li").eq(B).addClass("box").prepend(x)}}d.boxColor!=""&&g.find("li.box").css("border-color",d.boxColor),d.boxFill!=""&&g.find("li.box").addClass("box-bg").css("background-color",d.boxFill),a.browser.webkit&&(g.find(".snippet-num li.box").css("margin-left","-3.3em"),g.find(".snippet-num li .box-sp").css("width","21px"))}sh_highlightDocument(),d.menu?g.prev(".snippet-menu").find("pre,.snippet-clipboard").show():g.prev(".snippet-menu").find("pre,.snippet-clipboard").hide()}})}}(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return typeof a=="string"&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){var b=this.className.split(/\s+/),c=-1;for(var d=0;d<b.length;d++)b[d]==a&&(c=d,d=b.length);return c>-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};while(a&&a!=b)c.left+=a.offsetLeft,c.top+=a.offsetTop,a=a.offsetParent;return c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1),typeof b=="string"?b=ZeroClipboard.$(b):typeof b=="undefined"&&(b=document.getElementsByTagName("body")[0]);var e=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div"),this.div.className="snippet-clipboard";var f=this.div.style;f.position="absolute",f.left=""+e.left+"px",f.top=""+e.top+"px",f.width=""+e.width+"px",f.height=""+e.height+"px",f.zIndex=d;if(typeof c=="object")for(addedStyle in c)f[addedStyle]=c[addedStyle];b.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>'}else c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+d+'" wmode="transparent" />';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide());if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100),this.ready=!0;return}this.ready=!0;try{this.movie.setText(this.clipText)}catch(d){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(d){}break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var e=0,f=this.handlers[a].length;e<f;e++){var g=this.handlers[a][e];typeof g=="function"?g(this,b):typeof g=="object"&&g.length==2?g[0][g[1]](this,b):typeof g=="string"&&window[g](this,b)}}},this.sh_languages||(this.sh_languages={});var sh_requests={};this.sh_languages||(this.sh_languages={}),sh_languages.c=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.cpp=[[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.csharp=[[[/\b(?:using)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))(?:[FfDdMmUulL]+)?\b/g,"sh_number",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|event|new|struct|as|explicit|null|switch|base|extern|this|false|operator|throw|break|finally|out|true|fixed|override|try|case|params|typeof|catch|for|private|foreach|protected|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|continue|in|return|virtual|default|interface|sealed|volatile|delegate|internal|do|is|sizeof|while|lock|stackalloc|else|static|enum|namespace|get|partial|set|value|where|yield)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.css=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(?:\.|#)[A-Za-z0-9_]+/g,"sh_selector",-1],[/\{/g,"sh_cbracket",10,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\}/g,"sh_cbracket",-2],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/[A-Za-z0-9_-]+[ \t]*:/g,"sh_property",-1],[/[.%A-Za-z0-9_-]+/g,"sh_value",-1],[/#(?:[A-Za-z0-9_]+)/g,"sh_string",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.flex=[[[/^%\{/g,"sh_preproc",1,1],[/^%[sx]/g,"sh_preproc",16,1],[/^%option/g,"sh_preproc",17,1],[/^%(?:array|pointer|[aceknopr])/g,"sh_preproc",-1],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_preproc",19,1],[/^%%/g,"sh_preproc",20,1]],[[/^%\}/g,"sh_preproc",-2],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",6]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",12],[/"/g,"sh_string",13],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_function",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_keyword",-1],[/"/g,"sh_string",18],[/=/g,"sh_symbol",-1]],[[/$/g,null,-2],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/"/g,"sh_string",13],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/^%%/g,"sh_preproc",21,1],[/<[A-Za-z_][A-Za-z0-9_-]*>/g,"sh_function",-1],[/"/g,"sh_string",13],[/\\./g,"sh_preproc",-1],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/\/\*/g,"sh_comment",22],[/\{/g,"sh_cbracket",23,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/\*\//g,"sh_comment",-2],[/\/\*/g,"sh_comment",22]],[[/\}/g,"sh_cbracket",-2],[/\{/g,"sh_cbracket",23,1],[/\$./g,"sh_variable",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.html=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",5,1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]],this.sh_languages||(this.sh_languages={}),sh_languages.java=[[[/\b(?:import|package)\b/g,"sh_preproc",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/(\b(?:class|interface))([ \t]+)([$A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|assert|break|case|catch|class|const|continue|default|do|else|extends|false|final|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|static|strictfp|super|switch|synchronized|throw|throws|true|this|transient|try|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.javascript=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.javascript_dom=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/\b(?:applicationCache|closed|Components|content|controllers|crypto|defaultStatus|dialogArguments|directories|document|frameElement|frames|fullScreen|globalStorage|history|innerHeight|innerWidth|length|location|locationbar|menubar|name|navigator|opener|outerHeight|outerWidth|pageXOffset|pageYOffset|parent|personalbar|pkcs11|returnValue|screen|availTop|availLeft|availHeight|availWidth|colorDepth|height|left|pixelDepth|top|width|screenX|screenY|scrollbars|scrollMaxX|scrollMaxY|scrollX|scrollY|self|sessionStorage|sidebar|status|statusbar|toolbar|top|window)\b/g,"sh_predef_var",-1],[/\b(?:alert|addEventListener|atob|back|blur|btoa|captureEvents|clearInterval|clearTimeout|close|confirm|dump|escape|find|focus|forward|getAttention|getComputedStyle|getSelection|home|moveBy|moveTo|open|openDialog|postMessage|print|prompt|releaseEvents|removeEventListener|resizeBy|resizeTo|scroll|scrollBy|scrollByLines|scrollByPages|scrollTo|setInterval|setTimeout|showModalDialog|sizeToContent|stop|unescape|updateCommands|onabort|onbeforeunload|onblur|onchange|onclick|onclose|oncontextmenu|ondragdrop|onerror|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onpaint|onreset|onresize|onscroll|onselect|onsubmit|onunload)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.perl=[[[/\b(?:import)\b/g,"sh_preproc",-1],[/(s)(\{(?:\\\}|[^}])*\}\{(?:\\\}|[^}])*\})([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\((?:\\\)|[^)])*\)\((?:\\\)|[^)])*\))([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\[(?:\\\]|[^\]])*\]\[(?:\\\]|[^\]])*\])([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(<.*><.*>)([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(q(?:q?))(\{(?:\\\}|[^}])*\})/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\((?:\\\)|[^)])*\))/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\[(?:\\\]|[^\]])*\])/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(<.*>)/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))([^A-Za-z0-9 \t])(.*\2)/g,["sh_keyword","sh_string","sh_string"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2.*\2)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_keyword"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2[ \t]*)([^A-Za-z0-9 \t])(.*\4)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_regexp","sh_regexp","sh_keyword"],-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/(?:m|qr)(?=\{)/g,"sh_keyword",2],[/(?:m|qr)(?=#)/g,"sh_keyword",4],[/(?:m|qr)(?=\|)/g,"sh_keyword",6],[/(?:m|qr)(?=@)/g,"sh_keyword",8],[/(?:m|qr)(?=<)/g,"sh_keyword",10],[/(?:m|qr)(?=\[)/g,"sh_keyword",12],[/(?:m|qr)(?=\\)/g,"sh_keyword",14],[/(?:m|qr)(?=\/)/g,"sh_keyword",16],[/"/g,"sh_string",18],[/'/g,"sh_string",19],[/</g,"sh_string",20],[/\/[^\n]*\//g,"sh_string",-1],[/\b(?:chomp|chop|chr|crypt|hex|i|index|lc|lcfirst|length|oct|ord|pack|q|qq|reverse|rindex|sprintf|substr|tr|uc|ucfirst|m|s|g|qw|abs|atan2|cos|exp|hex|int|log|oct|rand|sin|sqrt|srand|my|local|our|delete|each|exists|keys|values|pack|read|syscall|sysread|syswrite|unpack|vec|undef|unless|return|length|grep|sort|caller|continue|dump|eval|exit|goto|last|next|redo|sub|wantarray|pop|push|shift|splice|unshift|split|switch|join|defined|foreach|last|chop|chomp|bless|dbmclose|dbmopen|ref|tie|tied|untie|while|next|map|eq|die|cmp|lc|uc|and|do|if|else|elsif|for|use|require|package|import|chdir|chmod|chown|chroot|fcntl|glob|ioctl|link|lstat|mkdir|open|opendir|readlink|rename|rmdir|stat|symlink|umask|unlink|utime|binmode|close|closedir|dbmclose|dbmopen|die|eof|fileno|flock|format|getc|print|printf|read|readdir|rewinddir|seek|seekdir|select|syscall|sysread|sysseek|syswrite|tell|telldir|truncate|warn|write|alarm|exec|fork|getpgrp|getppid|getpriority|kill|pipe|qx|setpgrp|setpriority|sleep|system|times|x|wait|waitpid)\b/g,"sh_keyword",-1],[/^\=(?:head1|head2|item)/g,"sh_comment",21],[/(?:\$[#]?|@|%)[\/A-Za-z0-9_]+/g,"sh_variable",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\{/g,"sh_regexp",3]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\{|\\\}|\}/g,"sh_regexp",-3]],[[/#/g,"sh_regexp",5]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\#|#/g,"sh_regexp",-3]],[[/\|/g,"sh_regexp",7]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\||\|/g,"sh_regexp",-3]],[[/@/g,"sh_regexp",9]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\@|@/g,"sh_regexp",-3]],[[/</g,"sh_regexp",11]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\<|\\>|>/g,"sh_regexp",-3]],[[/\[/g,"sh_regexp",13]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\]|\]/g,"sh_regexp",-3]],[[/\\/g,"sh_regexp",15]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\\|\\/g,"sh_regexp",-3]],[[/\//g,"sh_regexp",17]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\/|\//g,"sh_regexp",-3]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/\=cut/g,"sh_comment",-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.php=[[[/\b(?:include|include_once|require|require_once)\b/g,"sh_preproc",-1],[/\/\//g,"sh_comment",1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/\b(?:and|or|xor|__FILE__|exception|php_user_filter|__LINE__|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|each|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|isset|list|new|old_function|print|return|static|switch|unset|use|var|while|__FUNCTION__|__CLASS__|__METHOD__)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",4],[/\/\//g,"sh_comment",1],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(?:\$[#]?|@|%)[A-Za-z0-9_]+/g,"sh_variable",-1],[/<\?php|~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",7]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.python=[[[/\b(?:import|from)\b/g,"sh_preproc",-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/\b(?:and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|global|if|in|is|lambda|not|or|pass|print|raise|return|try|while)\b/g,"sh_keyword",-1],[/^(?:[\s]*'{3})/g,"sh_comment",2],[/^(?:[\s]*\"{3})/g,"sh_comment",3],[/^(?:[\s]*'(?:[^\\']|\\.)*'[\s]*|[\s]*\"(?:[^\\\"]|\\.)*\"[\s]*)$/g,"sh_comment",-1],[/(?:[\s]*'{3})/g,"sh_string",4],[/(?:[\s]*\"{3})/g,"sh_string",5],[/"/g,"sh_string",6],[/'/g,"sh_string",7],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\||\{|\}/g,"sh_symbol",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/(?:'{3})/g,"sh_comment",-2]],[[/(?:\"{3})/g,"sh_comment",-2]],[[/(?:'{3})/g,"sh_string",-2]],[[/(?:\"{3})/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.ruby=[[[/\b(?:require)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/</g,"sh_string",3],[/\/[^\n]*\//g,"sh_regexp",-1],[/(%r)(\{(?:\\\}|#\{[A-Za-z0-9]+\}|[^}])*\})/g,["sh_symbol","sh_regexp"],-1],[/\b(?:alias|begin|BEGIN|break|case|defined|do|else|elsif|end|END|ensure|for|if|in|include|loop|next|raise|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|false|nil|self|true|__FILE__|__LINE__|and|not|or|def|class|module|catch|fail|load|throw)\b/g,"sh_keyword",-1],[/(?:^\=begin)/g,"sh_comment",4],[/(?:\$[#]?|@@|@)(?:[A-Za-z0-9_]+|'|\"|\/)/g,"sh_type",-1],[/[A-Za-z0-9]+(?:\?|!)/g,"sh_normal",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/(#)(\{)/g,["sh_symbol","sh_cbracket"],-1],[/#/g,"sh_comment",5],[/\{|\}/g,"sh_cbracket",-1]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/^(?:\=end)/g,"sh_comment",-2]],[[/$/g,null,-2]]],this.sh_languages||(this.sh_languages={}),sh_languages.sql=[[[/\b(?:VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b/gi,"sh_type",-1],[/\b(?:ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT|BETWEEN|BINARY|BOTH|BY|BOOLEAN|CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE|DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT|ENCLOSED|ESCAPED|EXISTS|EXPLAIN|FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM|GROUP|GRANT|HAVING|IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF|JOIN|KEYS|KILL|KEY|LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE|MODIFY|NATURAL|NOT|NULL|NEXTVAL|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON|PROCEDURE|PROCEDURAL|PRIMARY|READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT|SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET|TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED|UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW|WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b/gi,"sh_keyword",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/`/g,"sh_string",3],[/#/g,"sh_comment",4],[/\/\/\//g,"sh_comment",5],[/\/\//g,"sh_comment",4],[/\/\*\*/g,"sh_comment",11],[/\/\*/g,"sh_comment",12],[/--/g,"sh_comment",4],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/`/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",9]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]],this.sh_languages||(this.sh_languages={}),sh_languages.url=[[{regex:/(?:<?)[A-Za-z0-9_\.\/\-_]+@[A-Za-z0-9_\.\/\-_]+(?:>?)/g,style:"sh_url"},{regex:/(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_]+(?:>?)/g,style:"sh_url"}]],this.sh_languages||(this.sh_languages={}),sh_languages.xml=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]],$("pre.js").snippet("javascript",{style:"typical",showNum:!1}),moment.lang("en"),$("#js-format-now").html('"'+moment().format("dddd, MMMM Do YYYY, h:mm:ss a")+'"'),$("#js-from-now").html('"'+moment([2011,9,31]).fromNow()+'"'),$("#js-add").html('"'+moment().add("days",9).format("dddd, MMMM Do YYYY")+'"'),moment.lang("fr"),$("#js-lang").html('"'+moment().format("LLLL")+'"'),moment.lang("en")
\ No newline at end of file
+++ /dev/null
-(function(){var a={months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[avui a "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demá a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ca",a)})(),function(){var a={months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),longDateFormat:{LT:"H:mm U\\hr",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"einer Minute",mm:"%d Minuten",h:"einer Stunde",hh:"%d Stunden",d:"einem Tag",dd:"%d Tagen",M:"einem Monat",MM:"%d Monaten",y:"einem Jahr",yy:"%d Jahren"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("de",a)}(),function(){var a={months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("en-gb",a)}(),function(){var a={months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Ene._Feb._Mar._Abr._May._Jun._Jul._Ago._Sep._Oct._Nov._Dic.".split("_"),weekdays:"Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mié._Jue._Vie._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("es",a)}(),function(){var a={months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYYko MMMMren D[a]",LLL:"YYYYko MMMMren D[a] LT",LLLL:"dddd, YYYYko MMMMren D[a] LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("eu",a)}(),function(){var a={months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Ajourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"une année",yy:"%d années"},ordinal:function(a){return a===1?"er":"ème"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("fr",a)}(),function(){var a={months:"Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Octubro_Novembro_Decembro".split("_"),monthsShort:"Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.".split("_"),weekdays:"Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mér._Xov._Ven._Sáb.".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:function(){return"[hoxe "+(this.hours()!==1?"ás":"a")+"] LT"},nextDay:function(){return"[mañá "+(this.hours()!==1?"ás":"a")+"] LT"},nextWeek:function(){return"dddd ["+(this.hours()!==1?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(this.hours()!==1?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(this.hours()!==1?"ás":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundo",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("gl",a)}(),function(){var a={months:"Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settebre_Ottobre_Novembre_Dicembre".split("_"),monthsShort:"Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"),weekdays:"Domenica_Lunedi_Martedi_Mercoledi_Giovedi_Venerdi_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("it",a)}(),function(){var a={months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 mm분",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 LT",LLLL:"YYYY년 MMMM D일 dddd LT"},meridiem:{AM:"오전",am:"오전",PM:"오후",pm:"오후"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinal:function(a){return"일"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("kr",a)}(),function(){var a={months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[I dag klokken] LT",nextDay:"[I morgen klokken] LT",nextWeek:"dddd [klokken] LT",lastDay:"[I går klokken] LT",lastWeek:"[Forrige] dddd [klokken] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nb",a)}(),function(){var a={months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._mei._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a===1||a===8||a>=20?"ste":"de"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("nl",a)}(),function(){var a=function(a){return a%10<5&&a%10>1&&~~(a/10)!==1},b=function(b,c,d){var e=b+" ";switch(d){case"m":return c?"minuta":"minutę";case"mm":return e+(a(b)?"minuty":"minut");case"h":return c?"godzina":"godzinę";case"hh":return e+(a(b)?"godziny":"godzin");case"MM":return e+(a(b)?"miesiące":"miesięcy");case"yy":return e+(a(b)?"lata":"lat")}},c={months:"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:"[W zeszły/łą] dddd [o] LT",sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:b,mm:b,h:b,hh:b,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:b,y:"rok",yy:b},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=c),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pl",c)}(),function(){var a={months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY LT",LLLL:"dddd, D \\de MMMM \\de YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return this.day()===0||this.day()===6?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:function(a){return"º"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("pt",a)}(),function(){var a={months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_суб".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return this.day()===1?"[Во] dddd [в] LT":"[В] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:case 1:case 3:return"[В прошлый] dddd [в] LT";case 6:return"[В прошлое] dddd [в] LT";default:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:"минут",mm:"%d минут",h:"часа",hh:"%d часов",d:"1 день",dd:"%d дней",M:"месяц",MM:"%d месяцев",y:"год",yy:"%d лет"},ordinal:function(a){return"."}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("ru",a)}(),function(){var a={months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Idag klockan] LT",nextDay:"[Imorgon klockan] LT",lastDay:"[Igår klockan] LT",nextWeek:"dddd [klockan] LT",lastWeek:"[Förra] dddd [en klockan] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sen",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"e":b===1?"a":b===2?"a":b===3?"e":"e"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("sv",a)}(),function(){var a={months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}};typeof module!="undefined"&&(module.exports=a),typeof window!="undefined"&&this.moment&&this.moment.lang&&this.moment.lang("tr",a)}()
\ No newline at end of file
+++ /dev/null
-// Moment.js
-//
-// (c) 2011 Tim Wood
-// Moment.js is freely distributable under the terms of the MIT license.
-//
-// Version 1.4.0
-
-/*global define:false */
-
-(function (Date, undefined) {
-
- var moment,
- round = Math.round,
- languages = {},
- hasModule = (typeof module !== 'undefined'),
- paramsToParse = 'months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem'.split('|'),
- i,
- jsonRegex = /^\/?Date\((\d+)/i,
- charactersToReplace = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,
- nonuppercaseLetters = /[^A-Z]/g,
- timezoneRegex = /\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,
- tokenCharacters = /(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,
- inputCharacters = /(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,
- timezoneParseRegex = /([\+\-]|\d\d)/gi,
- VERSION = "1.4.0",
- shortcuts = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|');
-
- // Moment prototype object
- function Moment(date) {
- this._d = date;
- }
-
- // left zero fill a number
- // see http://jsperf.com/left-zero-filling for performance comparison
- function leftZeroFill(number, targetLength) {
- var output = number + '';
- while (output.length < targetLength) {
- output = '0' + output;
- }
- return output;
- }
-
- // helper function for _.addTime and _.subtractTime
- function dateAddRemove(date, _input, adding, val) {
- var isString = (typeof _input === 'string'),
- input = isString ? {} : _input,
- ms, d, M, currentDate;
- if (isString && val) {
- input[_input] = +val;
- }
- ms = (input.ms || input.milliseconds || 0) +
- (input.s || input.seconds || 0) * 1e3 + // 1000
- (input.m || input.minutes || 0) * 6e4 + // 1000 * 60
- (input.h || input.hours || 0) * 36e5; // 1000 * 60 * 60
- d = (input.d || input.days || 0) +
- (input.w || input.weeks || 0) * 7;
- M = (input.M || input.months || 0) +
- (input.y || input.years || 0) * 12;
- if (ms) {
- date.setTime(+date + ms * adding);
- }
- if (d) {
- date.setDate(date.getDate() + d * adding);
- }
- if (M) {
- currentDate = date.getDate();
- date.setDate(1);
- date.setMonth(date.getMonth() + M * adding);
- date.setDate(Math.min(new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(), currentDate));
- }
- return date;
- }
-
- // check if is an array
- function isArray(input) {
- return Object.prototype.toString.call(input) === '[object Array]';
- }
-
- // convert an array to a date.
- // the array should mirror the parameters below
- // note: all values past the year are optional and will default to the lowest possible value.
- // [year, month, day , hour, minute, second, millisecond]
- function dateFromArray(input) {
- return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);
- }
-
- // format date using native date object
- function formatDate(date, inputString) {
- var m = new Moment(date),
- currentMonth = m.month(),
- currentDate = m.date(),
- currentYear = m.year(),
- currentDay = m.day(),
- currentHours = m.hours(),
- currentMinutes = m.minutes(),
- currentSeconds = m.seconds(),
- currentZone = -m.zone(),
- ordinal = moment.ordinal,
- meridiem = moment.meridiem;
- // check if the character is a format
- // return formatted string or non string.
- //
- // uses switch/case instead of an object of named functions (like http://phpjs.org/functions/date:380)
- // for minification and performance
- // see http://jsperf.com/object-of-functions-vs-switch for performance comparison
- function replaceFunction(input) {
- // create a couple variables to be used later inside one of the cases.
- var a, b;
- switch (input) {
- // MONTH
- case 'M' :
- return currentMonth + 1;
- case 'Mo' :
- return (currentMonth + 1) + ordinal(currentMonth + 1);
- case 'MM' :
- return leftZeroFill(currentMonth + 1, 2);
- case 'MMM' :
- return moment.monthsShort[currentMonth];
- case 'MMMM' :
- return moment.months[currentMonth];
- // DAY OF MONTH
- case 'D' :
- return currentDate;
- case 'Do' :
- return currentDate + ordinal(currentDate);
- case 'DD' :
- return leftZeroFill(currentDate, 2);
- // DAY OF YEAR
- case 'DDD' :
- a = new Date(currentYear, currentMonth, currentDate);
- b = new Date(currentYear, 0, 1);
- return ~~ (((a - b) / 864e5) + 1.5);
- case 'DDDo' :
- a = replaceFunction('DDD');
- return a + ordinal(a);
- case 'DDDD' :
- return leftZeroFill(replaceFunction('DDD'), 3);
- // WEEKDAY
- case 'd' :
- return currentDay;
- case 'do' :
- return currentDay + ordinal(currentDay);
- case 'ddd' :
- return moment.weekdaysShort[currentDay];
- case 'dddd' :
- return moment.weekdays[currentDay];
- // WEEK OF YEAR
- case 'w' :
- a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);
- b = new Date(a.getFullYear(), 0, 4);
- return ~~ ((a - b) / 864e5 / 7 + 1.5);
- case 'wo' :
- a = replaceFunction('w');
- return a + ordinal(a);
- case 'ww' :
- return leftZeroFill(replaceFunction('w'), 2);
- // YEAR
- case 'YY' :
- return leftZeroFill(currentYear % 100, 2);
- case 'YYYY' :
- return currentYear;
- // AM / PM
- case 'a' :
- return currentHours > 11 ? meridiem.pm : meridiem.am;
- case 'A' :
- return currentHours > 11 ? meridiem.PM : meridiem.AM;
- // 24 HOUR
- case 'H' :
- return currentHours;
- case 'HH' :
- return leftZeroFill(currentHours, 2);
- // 12 HOUR
- case 'h' :
- return currentHours % 12 || 12;
- case 'hh' :
- return leftZeroFill(currentHours % 12 || 12, 2);
- // MINUTE
- case 'm' :
- return currentMinutes;
- case 'mm' :
- return leftZeroFill(currentMinutes, 2);
- // SECOND
- case 's' :
- return currentSeconds;
- case 'ss' :
- return leftZeroFill(currentSeconds, 2);
- // TIMEZONE
- case 'zz' :
- // depreciating 'zz' fall through to 'z'
- case 'z' :
- return (date.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');
- case 'Z' :
- return (currentZone > 0 ? '+' : '-') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);
- case 'ZZ' :
- return (currentZone > 0 ? '+' : '-') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);
- // LONG DATES
- case 'L' :
- case 'LL' :
- case 'LLL' :
- case 'LLLL' :
- case 'LT' :
- return formatDate(date, moment.longDateFormat[input]);
- // DEFAULT
- default :
- return input.replace(/(^\[)|(\\)|\]$/g, "");
- }
- }
- return inputString.replace(charactersToReplace, replaceFunction);
- }
-
- // date from string and format string
- function makeDateFromStringAndFormat(string, format) {
- var inArray = [0, 0, 1, 0, 0, 0, 0],
- timezoneHours = 0,
- timezoneMinutes = 0,
- isUsingUTC = false,
- inputParts = string.match(inputCharacters),
- formatParts = format.match(tokenCharacters),
- i,
- isPm;
-
- // function to convert string input to date
- function addTime(format, input) {
- var a;
- switch (format) {
- // MONTH
- case 'M' :
- // fall through to MM
- case 'MM' :
- inArray[1] = ~~input - 1;
- break;
- case 'MMM' :
- // fall through to MMMM
- case 'MMMM' :
- for (a = 0; a < 12; a++) {
- if (moment.monthsParse[a].test(input)) {
- inArray[1] = a;
- break;
- }
- }
- break;
- // DAY OF MONTH
- case 'D' :
- // fall through to DDDD
- case 'DD' :
- // fall through to DDDD
- case 'DDD' :
- // fall through to DDDD
- case 'DDDD' :
- inArray[2] = ~~input;
- break;
- // YEAR
- case 'YY' :
- input = ~~input;
- inArray[0] = input + (input > 70 ? 1900 : 2000);
- break;
- case 'YYYY' :
- inArray[0] = ~~Math.abs(input);
- break;
- // AM / PM
- case 'a' :
- // fall through to A
- case 'A' :
- isPm = (input.toLowerCase() === 'pm');
- break;
- // 24 HOUR
- case 'H' :
- // fall through to hh
- case 'HH' :
- // fall through to hh
- case 'h' :
- // fall through to hh
- case 'hh' :
- inArray[3] = ~~input;
- break;
- // MINUTE
- case 'm' :
- // fall through to mm
- case 'mm' :
- inArray[4] = ~~input;
- break;
- // SECOND
- case 's' :
- // fall through to ss
- case 'ss' :
- inArray[5] = ~~input;
- break;
- // TIMEZONE
- case 'Z' :
- // fall through to ZZ
- case 'ZZ' :
- isUsingUTC = true;
- a = (input || '').match(timezoneParseRegex);
- if (a && a[1]) {
- timezoneHours = ~~a[1];
- }
- if (a && a[2]) {
- timezoneMinutes = ~~a[2];
- }
- // reverse offsets
- if (a && a[0] === '+') {
- timezoneHours = -timezoneHours;
- timezoneMinutes = -timezoneMinutes;
- }
- break;
- }
- }
- for (i = 0; i < formatParts.length; i++) {
- addTime(formatParts[i], inputParts[i]);
- }
- // handle am pm
- if (isPm && inArray[3] < 12) {
- inArray[3] += 12;
- }
- // if is 12 am, change hours to 0
- if (isPm === false && inArray[3] === 12) {
- inArray[3] = 0;
- }
- // handle timezone
- inArray[3] += timezoneHours;
- inArray[4] += timezoneMinutes;
- // return
- return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);
- }
-
- // compare two arrays, return the number of differences
- function compareArrays(array1, array2) {
- var len = Math.min(array1.length, array2.length),
- lengthDiff = Math.abs(array1.length - array2.length),
- diffs = 0,
- i;
- for (i = 0; i < len; i++) {
- if (~~array1[i] !== ~~array2[i]) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
- }
-
- // date from string and array of format strings
- function makeDateFromStringAndArray(string, formats) {
- var output,
- inputParts = string.match(inputCharacters),
- scores = [],
- scoreToBeat = 99,
- i,
- curDate,
- curScore;
- for (i = 0; i < formats.length; i++) {
- curDate = makeDateFromStringAndFormat(string, formats[i]);
- curScore = compareArrays(inputParts, formatDate(curDate, formats[i]).match(inputCharacters));
- if (curScore < scoreToBeat) {
- scoreToBeat = curScore;
- output = curDate;
- }
- }
- return output;
- }
-
- moment = function (input, format) {
- if (input === null) {
- return null;
- }
- var date,
- matched;
- // parse Moment object
- if (input && input._d instanceof Date) {
- date = new Date(+input._d);
- // parse string and format
- } else if (format) {
- if (isArray(format)) {
- date = makeDateFromStringAndArray(input, format);
- } else {
- date = makeDateFromStringAndFormat(input, format);
- }
- // evaluate it as a JSON-encoded date
- } else {
- matched = jsonRegex.exec(input);
- date = input === undefined ? new Date() :
- matched ? new Date(+matched[1]) :
- input instanceof Date ? input :
- isArray(input) ? dateFromArray(input) :
- new Date(input);
- }
- return new Moment(date);
- };
-
- // version number
- moment.version = VERSION;
-
- // language switching and caching
- moment.lang = function (key, values) {
- var i,
- param,
- req,
- parse = [];
- if (values) {
- for (i = 0; i < 12; i++) {
- parse[i] = new RegExp('^' + values.months[i] + '|^' + values.monthsShort[i].replace('.', ''), 'i');
- }
- values.monthsParse = values.monthsParse || parse;
- languages[key] = values;
- }
- if (languages[key]) {
- for (i = 0; i < paramsToParse.length; i++) {
- param = paramsToParse[i];
- moment[param] = languages[key][param] || moment[param];
- }
- } else {
- if (hasModule) {
- req = require('./lang/' + key);
- moment.lang(key, req);
- }
- }
- };
-
- // set default language
- moment.lang('en', {
- months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
- monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
- weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
- weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
- longDateFormat : {
- LT : "h:mm A",
- L : "MM/DD/YYYY",
- LL : "MMMM D YYYY",
- LLL : "MMMM D YYYY LT",
- LLLL : "dddd, MMMM D YYYY LT"
- },
- meridiem : {
- AM : 'AM',
- am : 'am',
- PM : 'PM',
- pm : 'pm'
- },
- calendar : {
- sameDay : '[Today at] LT',
- nextDay : '[Tomorrow at] LT',
- nextWeek : 'dddd [at] LT',
- lastDay : '[Yesterday at] LT',
- lastWeek : '[last] dddd [at] LT',
- sameElse : 'L'
- },
- relativeTime : {
- future : "in %s",
- past : "%s ago",
- s : "a few seconds",
- m : "a minute",
- mm : "%d minutes",
- h : "an hour",
- hh : "%d hours",
- d : "a day",
- dd : "%d days",
- M : "a month",
- MM : "%d months",
- y : "a year",
- yy : "%d years"
- },
- ordinal : function (number) {
- var b = number % 10;
- return (~~ (number % 100 / 10) === 1) ? 'th' :
- (b === 1) ? 'st' :
- (b === 2) ? 'nd' :
- (b === 3) ? 'rd' : 'th';
- }
- });
-
- // helper function for _date.from() and _date.fromNow()
- function substituteTimeAgo(string, number, withoutSuffix) {
- var rt = moment.relativeTime[string];
- return (typeof rt === 'function') ?
- rt(number || 1, !!withoutSuffix, string) :
- rt.replace(/%d/i, number || 1);
- }
-
- function relativeTime(milliseconds, withoutSuffix) {
- var seconds = round(Math.abs(milliseconds) / 1000),
- minutes = round(seconds / 60),
- hours = round(minutes / 60),
- days = round(hours / 24),
- years = round(days / 365),
- args = seconds < 45 && ['s', seconds] ||
- minutes === 1 && ['m'] ||
- minutes < 45 && ['mm', minutes] ||
- hours === 1 && ['h'] ||
- hours < 22 && ['hh', hours] ||
- days === 1 && ['d'] ||
- days <= 25 && ['dd', days] ||
- days <= 45 && ['M'] ||
- days < 345 && ['MM', round(days / 30)] ||
- years === 1 && ['y'] || ['yy', years];
- args[2] = withoutSuffix;
- return substituteTimeAgo.apply({}, args);
- }
-
- // shortcut for prototype
- moment.fn = Moment.prototype = {
-
- clone : function () {
- return moment(this);
- },
-
- valueOf : function () {
- return +this._d;
- },
-
- 'native' : function () {
- return this._d;
- },
-
- toString : function () {
- return this._d.toString();
- },
-
- toDate : function () {
- return this._d;
- },
-
- format : function (inputString) {
- return formatDate(this._d, inputString);
- },
-
- add : function (input, val) {
- this._d = dateAddRemove(this._d, input, 1, val);
- return this;
- },
-
- subtract : function (input, val) {
- this._d = dateAddRemove(this._d, input, -1, val);
- return this;
- },
-
- diff : function (input, val, asFloat) {
- var inputMoment = moment(input),
- zoneDiff = (this.zone() - inputMoment.zone()) * 6e4,
- diff = this._d - inputMoment._d - zoneDiff,
- year = this.year() - inputMoment.year(),
- month = this.month() - inputMoment.month(),
- date = this.date() - inputMoment.date(),
- output;
- if (val === 'months') {
- output = year * 12 + month + date / 30;
- } else if (val === 'years') {
- output = year + month / 12;
- } else {
- output = val === 'seconds' ? diff / 1e3 : // 1000
- val === 'minutes' ? diff / 6e4 : // 1000 * 60
- val === 'hours' ? diff / 36e5 : // 1000 * 60 * 60
- val === 'days' ? diff / 864e5 : // 1000 * 60 * 60 * 24
- val === 'weeks' ? diff / 6048e5 : // 1000 * 60 * 60 * 24 * 7
- diff;
- }
- return asFloat ? output : round(output);
- },
-
- from : function (time, withoutSuffix) {
- var difference = this.diff(time),
- rel = moment.relativeTime,
- output = relativeTime(difference, withoutSuffix);
- return withoutSuffix ? output : (difference <= 0 ? rel.past : rel.future).replace(/%s/i, output);
- },
-
- fromNow : function (withoutSuffix) {
- return this.from(moment(), withoutSuffix);
- },
-
- calendar : function () {
- var diff = this.diff(moment().sod(), 'days', true),
- calendar = moment.calendar,
- allElse = calendar.sameElse,
- format = diff < -6 ? allElse :
- diff < -1 ? calendar.lastWeek :
- diff < 0 ? calendar.lastDay :
- diff < 1 ? calendar.sameDay :
- diff < 2 ? calendar.nextDay :
- diff < 7 ? calendar.nextWeek : allElse;
- return this.format(typeof format === 'function' ? format.apply(this) : format);
- },
-
- isLeapYear : function () {
- var year = this.year();
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
- },
-
- isDST : function () {
- return (this.zone() < moment([this.year()]).zone() ||
- this.zone() < moment([this.year(), 5]).zone());
- },
-
- day : function (input) {
- var day = this._d.getDay();
- return input == null ? day :
- this.add({ d : input - day });
- },
-
- sod: function () {
- return this.clone()
- .hours(0)
- .minutes(0)
- .seconds(0)
- .milliseconds(0);
- },
-
- eod: function () {
- // end of day = start of day plus 1 day, minus 1 millisecond
- return this.sod().add({
- d : 1,
- ms : -1
- });
- }
- };
-
- // helper for adding shortcuts
- function makeShortcut(name, key) {
- moment.fn[name] = function (input) {
- if (input != null) {
- this._d['set' + key](input);
- return this;
- } else {
- return this._d['get' + key]();
- }
- };
- }
-
- // loop through and add shortcuts (Month, Date, Hours, Minutes, Seconds, Milliseconds)
- for (i = 0; i < shortcuts.length; i ++) {
- makeShortcut(shortcuts[i].toLowerCase(), shortcuts[i]);
- }
-
- // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear')
- makeShortcut('year', 'FullYear');
-
- // add shortcut for timezone offset (no setter)
- moment.fn.zone = function () {
- return this._d.getTimezoneOffset();
- };
-
- // CommonJS module is defined
- if (hasModule) {
- module.exports = moment;
- }
- if (typeof window !== 'undefined') {
- window.moment = moment;
- }
- if (typeof define === "function" && define.amd) {
- define("moment", [], function () {
- return moment;
- });
- }
-})(Date);
+++ /dev/null
-/* Moment.js | version : 1.4.0 | author : Tim Wood | license : MIT */
-(function(a,b){function r(a){this._d=a}function s(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function t(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j,k;return f&&e&&(g[c]=+e),h=(g.ms||g.milliseconds||0)+(g.s||g.seconds||0)*1e3+(g.m||g.minutes||0)*6e4+(g.h||g.hours||0)*36e5,i=(g.d||g.days||0)+(g.w||g.weeks||0)*7,j=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&b.setDate(b.getDate()+i*d),j&&(k=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+j*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),k))),b}function u(a){return Object.prototype.toString.call(a)==="[object Array]"}function v(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function w(b,d){function u(d){var e,j;switch(d){case"M":return f+1;case"Mo":return f+1+q(f+1);case"MM":return s(f+1,2);case"MMM":return c.monthsShort[f];case"MMMM":return c.months[f];case"D":return g;case"Do":return g+q(g);case"DD":return s(g,2);case"DDD":return e=new a(h,f,g),j=new a(h,0,1),~~((e-j)/864e5+1.5);case"DDDo":return e=u("DDD"),e+q(e);case"DDDD":return s(u("DDD"),3);case"d":return i;case"do":return i+q(i);case"ddd":return c.weekdaysShort[i];case"dddd":return c.weekdays[i];case"w":return e=new a(h,f,g-i+5),j=new a(e.getFullYear(),0,4),~~((e-j)/864e5/7+1.5);case"wo":return e=u("w"),e+q(e);case"ww":return s(u("w"),2);case"YY":return s(h%100,2);case"YYYY":return h;case"a":return m>11?t.pm:t.am;case"A":return m>11?t.PM:t.AM;case"H":return m;case"HH":return s(m,2);case"h":return m%12||12;case"hh":return s(m%12||12,2);case"m":return n;case"mm":return s(n,2);case"s":return o;case"ss":return s(o,2);case"zz":case"z":return(b.toString().match(l)||[""])[0].replace(k,"");case"Z":return(p>0?"+":"-")+s(~~(Math.abs(p)/60),2)+":"+s(~~(Math.abs(p)%60),2);case"ZZ":return(p>0?"+":"-")+s(~~(10*Math.abs(p)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return w(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=new r(b),f=e.month(),g=e.date(),h=e.year(),i=e.day(),m=e.hours(),n=e.minutes(),o=e.seconds(),p=-e.zone(),q=c.ordinal,t=c.meridiem;return d.replace(j,u)}function x(b,d){function p(a,b){var d;switch(a){case"M":case"MM":e[1]=~~b-1;break;case"MMM":case"MMMM":for(d=0;d<12;d++)if(c.monthsParse[d].test(b)){e[1]=d;break}break;case"D":case"DD":case"DDD":case"DDDD":e[2]=~~b;break;case"YY":b=~~b,e[0]=b+(b>70?1900:2e3);break;case"YYYY":e[0]=~~Math.abs(b);break;case"a":case"A":l=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":e[3]=~~b;break;case"m":case"mm":e[4]=~~b;break;case"s":case"ss":e[5]=~~b;break;case"Z":case"ZZ":h=!0,d=(b||"").match(o),d&&d[1]&&(f=~~d[1]),d&&d[2]&&(g=~~d[2]),d&&d[0]==="+"&&(f=-f,g=-g)}}var e=[0,0,1,0,0,0,0],f=0,g=0,h=!1,i=b.match(n),j=d.match(m),k,l;for(k=0;k<j.length;k++)p(j[k],i[k]);return l&&e[3]<12&&(e[3]+=12),l===!1&&e[3]===12&&(e[3]=0),e[3]+=f,e[4]+=g,h?new a(a.UTC.apply({},e)):v(e)}function y(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function z(a,b){var c,d=a.match(n),e=[],f=99,g,h,i;for(g=0;g<b.length;g++)h=x(a,b[g]),i=y(d,w(h,b[g]).match(n)),i<f&&(f=i,c=h);return c}function A(a,b,d){var e=c.relativeTime[a];return typeof e=="function"?e(b||1,!!d,a):e.replace(/%d/i,b||1)}function B(a,b){var c=d(Math.abs(a)/1e3),e=d(c/60),f=d(e/60),g=d(f/24),h=d(g/365),i=c<45&&["s",c]||e===1&&["m"]||e<45&&["mm",e]||f===1&&["h"]||f<22&&["hh",f]||g===1&&["d"]||g<=25&&["dd",g]||g<=45&&["M"]||g<345&&["MM",d(g/30)]||h===1&&["y"]||["yy",h];return i[2]=b,A.apply({},i)}function C(a,b){c.fn[a]=function(a){return a!=null?(this._d["set"+b](a),this):this._d["get"+b]()}}var c,d=Math.round,e={},f=typeof module!="undefined",g="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),h,i=/^\/?Date\((\d+)/i,j=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|ZZ?|LT|LL?L?L?)/g,k=/[^A-Z]/g,l=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,m=/(\\)?(MM?M?M?|dd?d?d|DD?D?D?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|ZZ?|T)/g,n=/(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,o=/([\+\-]|\d\d)/gi,p="1.4.0",q="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|");c=function(c,d){if(c===null)return null;var e,f;return c&&c._d instanceof a?e=new a(+c._d):d?u(d)?e=z(c,d):e=x(c,d):(f=i.exec(c),e=c===b?new a:f?new a(+f[1]):c instanceof a?c:u(c)?v(c):new a(c)),new r(e)},c.version=p,c.lang=function(a,b){var d,h,i,j=[];if(b){for(d=0;d<12;d++)j[d]=new RegExp("^"+b.months[d]+"|^"+b.monthsShort[d].replace(".",""),"i");b.monthsParse=b.monthsParse||j,e[a]=b}if(e[a])for(d=0;d<g.length;d++)h=g[d],c[h]=e[a][h]||c[h];else f&&(i=require("./lang/"+a),c.lang(a,i))},c.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:{AM:"AM",am:"am",PM:"PM",pm:"pm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=r.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},"native":function(){return this._d},toString:function(){return this._d.toString()},toDate:function(){return this._d},format:function(a){return w(this._d,a)},add:function(a,b){return this._d=t(this._d,a,1,b),this},subtract:function(a,b){return this._d=t(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+j/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=B(d,b);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=c.calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<c([this.year()]).zone()||this.zone()<c([this.year(),5]).zone()},day:function(a){var b=this._d.getDay();return a==null?b:this.add({d:a-b})},sod:function(){return this.clone().hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})}};for(h=0;h<q.length;h++)C(q[h].toLowerCase(),q[h]);C("year","FullYear"),c.fn.zone=function(){return this._d.getTimezoneOffset()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c),typeof define=="function"&&define.amd&&define("moment",[],function(){return c})})(Date)
\ No newline at end of file
+++ /dev/null
-/*
- * QUnit - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2011 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
- */
-
-(function(window) {
-
-var defined = {
- setTimeout: typeof window.setTimeout !== "undefined",
- sessionStorage: (function() {
- try {
- return !!sessionStorage.getItem;
- } catch(e){
- return false;
- }
- })()
-};
-
-var testId = 0;
-
-var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
- this.name = name;
- this.testName = testName;
- this.expected = expected;
- this.testEnvironmentArg = testEnvironmentArg;
- this.async = async;
- this.callback = callback;
- this.assertions = [];
-};
-Test.prototype = {
- init: function() {
- var tests = id("qunit-tests");
- if (tests) {
- var b = document.createElement("strong");
- b.innerHTML = "Running " + this.name;
- var li = document.createElement("li");
- li.appendChild( b );
- li.className = "running";
- li.id = this.id = "test-output" + testId++;
- tests.appendChild( li );
- }
- },
- setup: function() {
- if (this.module != config.previousModule) {
- if ( config.previousModule ) {
- QUnit.moduleDone( {
- name: config.previousModule,
- failed: config.moduleStats.bad,
- passed: config.moduleStats.all - config.moduleStats.bad,
- total: config.moduleStats.all
- } );
- }
- config.previousModule = this.module;
- config.moduleStats = { all: 0, bad: 0 };
- QUnit.moduleStart( {
- name: this.module
- } );
- }
-
- config.current = this;
- this.testEnvironment = extend({
- setup: function() {},
- teardown: function() {}
- }, this.moduleTestEnvironment);
- if (this.testEnvironmentArg) {
- extend(this.testEnvironment, this.testEnvironmentArg);
- }
-
- QUnit.testStart( {
- name: this.testName
- } );
-
- // allow utility functions to access the current test environment
- // TODO why??
- QUnit.current_testEnvironment = this.testEnvironment;
-
- try {
- if ( !config.pollution ) {
- saveGlobal();
- }
-
- this.testEnvironment.setup.call(this.testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
- }
- },
- run: function() {
- if ( this.async ) {
- QUnit.stop();
- }
-
- if ( config.notrycatch ) {
- this.callback.call(this.testEnvironment);
- return;
- }
- try {
- this.callback.call(this.testEnvironment);
- } catch(e) {
- fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
- QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
- // else next test will carry the responsibility
- saveGlobal();
-
- // Restart the tests if they're blocking
- if ( config.blocking ) {
- start();
- }
- }
- },
- teardown: function() {
- try {
- checkPollution();
- this.testEnvironment.teardown.call(this.testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
- }
- },
- finish: function() {
- if ( this.expected && this.expected != this.assertions.length ) {
- QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
- }
-
- var good = 0, bad = 0,
- tests = id("qunit-tests");
-
- config.stats.all += this.assertions.length;
- config.moduleStats.all += this.assertions.length;
-
- if ( tests ) {
- var ol = document.createElement("ol");
-
- for ( var i = 0; i < this.assertions.length; i++ ) {
- var assertion = this.assertions[i];
-
- var li = document.createElement("li");
- li.className = assertion.result ? "pass" : "fail";
- li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
- ol.appendChild( li );
-
- if ( assertion.result ) {
- good++;
- } else {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
-
- // store result when possible
- QUnit.config.reorder && defined.sessionStorage && sessionStorage.setItem("qunit-" + this.testName, bad);
-
- if (bad == 0) {
- ol.style.display = "none";
- }
-
- var b = document.createElement("strong");
- b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
-
- addEvent(b, "click", function() {
- var next = b.nextSibling, display = next.style.display;
- next.style.display = display === "none" ? "block" : "none";
- });
-
- addEvent(b, "dblclick", function(e) {
- var target = e && e.target ? e.target : window.event.srcElement;
- if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
- target = target.parentNode;
- }
- if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
- window.location.search = "?" + encodeURIComponent(getText([target]).replace(/\(.+\)$/, "").replace(/(^\s*|\s*$)/g, ""));
- }
- });
-
- var li = id(this.id);
- li.className = bad ? "fail" : "pass";
- li.removeChild( li.firstChild );
- li.appendChild( b );
- li.appendChild( ol );
-
- } else {
- for ( var i = 0; i < this.assertions.length; i++ ) {
- if ( !this.assertions[i].result ) {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
- }
-
- try {
- QUnit.reset();
- } catch(e) {
- fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
- }
-
- QUnit.testDone( {
- name: this.testName,
- failed: bad,
- passed: this.assertions.length - bad,
- total: this.assertions.length
- } );
- },
-
- queue: function() {
- var test = this;
- synchronize(function() {
- test.init();
- });
- function run() {
- // each of these can by async
- synchronize(function() {
- test.setup();
- });
- synchronize(function() {
- test.run();
- });
- synchronize(function() {
- test.teardown();
- });
- synchronize(function() {
- test.finish();
- });
- }
- // defer when previous test run passed, if storage is available
- var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.testName);
- if (bad) {
- run();
- } else {
- synchronize(run);
- };
- }
-
-};
-
-var QUnit = {
-
- // call on start of module test to prepend name to all tests
- module: function(name, testEnvironment) {
- config.currentModule = name;
- config.currentModuleTestEnviroment = testEnvironment;
- },
-
- asyncTest: function(testName, expected, callback) {
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = 0;
- }
-
- QUnit.test(testName, expected, callback, true);
- },
-
- test: function(testName, expected, callback, async) {
- var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
-
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = null;
- }
- // is 2nd argument a testEnvironment?
- if ( expected && typeof expected === 'object') {
- testEnvironmentArg = expected;
- expected = null;
- }
-
- if ( config.currentModule ) {
- name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
- }
-
- if ( !validTest(config.currentModule + ": " + testName) ) {
- return;
- }
-
- var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
- test.module = config.currentModule;
- test.moduleTestEnvironment = config.currentModuleTestEnviroment;
- test.queue();
- },
-
- /**
- * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
- */
- expect: function(asserts) {
- config.current.expected = asserts;
- },
-
- /**
- * Asserts true.
- * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
- */
- ok: function(a, msg) {
- a = !!a;
- var details = {
- result: a,
- message: msg
- };
- msg = escapeHtml(msg);
- QUnit.log(details);
- config.current.assertions.push({
- result: a,
- message: msg
- });
- },
-
- /**
- * Checks that the first two arguments are equal, with an optional message.
- * Prints out both actual and expected values.
- *
- * Prefered to ok( actual == expected, message )
- *
- * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
- *
- * @param Object actual
- * @param Object expected
- * @param String message (optional)
- */
- equal: function(actual, expected, message) {
- QUnit.push(expected == actual, actual, expected, message);
- },
-
- notEqual: function(actual, expected, message) {
- QUnit.push(expected != actual, actual, expected, message);
- },
-
- deepEqual: function(actual, expected, message) {
- QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
- },
-
- notDeepEqual: function(actual, expected, message) {
- QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
- },
-
- strictEqual: function(actual, expected, message) {
- QUnit.push(expected === actual, actual, expected, message);
- },
-
- notStrictEqual: function(actual, expected, message) {
- QUnit.push(expected !== actual, actual, expected, message);
- },
-
- raises: function(block, expected, message) {
- var actual, ok = false;
-
- if (typeof expected === 'string') {
- message = expected;
- expected = null;
- }
-
- try {
- block();
- } catch (e) {
- actual = e;
- }
-
- if (actual) {
- // we don't want to validate thrown error
- if (!expected) {
- ok = true;
- // expected is a regexp
- } else if (QUnit.objectType(expected) === "regexp") {
- ok = expected.test(actual);
- // expected is a constructor
- } else if (actual instanceof expected) {
- ok = true;
- // expected is a validation function which returns true is validation passed
- } else if (expected.call({}, actual) === true) {
- ok = true;
- }
- }
-
- QUnit.ok(ok, message);
- },
-
- start: function() {
- config.semaphore--;
- if (config.semaphore > 0) {
- // don't start until equal number of stop-calls
- return;
- }
- if (config.semaphore < 0) {
- // ignore if start is called more often then stop
- config.semaphore = 0;
- }
- // A slight delay, to avoid any current callbacks
- if ( defined.setTimeout ) {
- window.setTimeout(function() {
- if ( config.timeout ) {
- clearTimeout(config.timeout);
- }
-
- config.blocking = false;
- process();
- }, 13);
- } else {
- config.blocking = false;
- process();
- }
- },
-
- stop: function(timeout) {
- config.semaphore++;
- config.blocking = true;
-
- if ( timeout && defined.setTimeout ) {
- clearTimeout(config.timeout);
- config.timeout = window.setTimeout(function() {
- QUnit.ok( false, "Test timed out" );
- QUnit.start();
- }, timeout);
- }
- }
-
-};
-
-// Backwards compatibility, deprecated
-QUnit.equals = QUnit.equal;
-QUnit.same = QUnit.deepEqual;
-
-// Maintain internal state
-var config = {
- // The queue of tests to run
- queue: [],
-
- // block until document ready
- blocking: true,
-
- // by default, run previously failed tests first
- // very useful in combination with "Hide passed tests" checked
- reorder: true
-};
-
-// Load paramaters
-(function() {
- var location = window.location || { search: "", protocol: "file:" },
- GETParams = location.search.slice(1).split('&');
-
- for ( var i = 0; i < GETParams.length; i++ ) {
- GETParams[i] = decodeURIComponent( GETParams[i] );
- if ( GETParams[i] === "noglobals" ) {
- GETParams.splice( i, 1 );
- i--;
- config.noglobals = true;
- } else if ( GETParams[i] === "notrycatch" ) {
- GETParams.splice( i, 1 );
- i--;
- config.notrycatch = true;
- } else if ( GETParams[i].search('=') > -1 ) {
- GETParams.splice( i, 1 );
- i--;
- }
- }
-
- // restrict modules/tests by get parameters
- config.filters = GETParams;
-
- // Figure out if we're running the tests from a server or not
- QUnit.isLocal = !!(location.protocol === 'file:');
-})();
-
-// Expose the API as global variables, unless an 'exports'
-// object exists, in that case we assume we're in CommonJS
-if ( typeof exports === "undefined" || typeof require === "undefined" ) {
- extend(window, QUnit);
- window.QUnit = QUnit;
-} else {
- extend(exports, QUnit);
- exports.QUnit = QUnit;
-}
-
-// define these after exposing globals to keep them in these QUnit namespace only
-extend(QUnit, {
- config: config,
-
- // Initialize the configuration options
- init: function() {
- extend(config, {
- stats: { all: 0, bad: 0 },
- moduleStats: { all: 0, bad: 0 },
- started: +new Date,
- updateRate: 1000,
- blocking: false,
- autostart: true,
- autorun: false,
- filters: [],
- queue: [],
- semaphore: 0
- });
-
- var tests = id( "qunit-tests" ),
- banner = id( "qunit-banner" ),
- result = id( "qunit-testresult" );
-
- if ( tests ) {
- tests.innerHTML = "";
- }
-
- if ( banner ) {
- banner.className = "";
- }
-
- if ( result ) {
- result.parentNode.removeChild( result );
- }
-
- if ( tests ) {
- result = document.createElement( "p" );
- result.id = "qunit-testresult";
- result.className = "result";
- tests.parentNode.insertBefore( result, tests );
- result.innerHTML = 'Running...<br/> ';
- }
- },
-
- /**
- * Resets the test setup. Useful for tests that modify the DOM.
- *
- * If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
- */
- reset: function() {
- if ( window.jQuery ) {
- jQuery( "#main, #qunit-fixture" ).html( config.fixture );
- } else {
- var main = id( 'main' ) || id( 'qunit-fixture' );
- if ( main ) {
- main.innerHTML = config.fixture;
- }
- }
- },
-
- /**
- * Trigger an event on an element.
- *
- * @example triggerEvent( document.body, "click" );
- *
- * @param DOMElement elem
- * @param String type
- */
- triggerEvent: function( elem, type, event ) {
- if ( document.createEvent ) {
- event = document.createEvent("MouseEvents");
- event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- elem.dispatchEvent( event );
-
- } else if ( elem.fireEvent ) {
- elem.fireEvent("on"+type);
- }
- },
-
- // Safe object type checking
- is: function( type, obj ) {
- return QUnit.objectType( obj ) == type;
- },
-
- objectType: function( obj ) {
- if (typeof obj === "undefined") {
- return "undefined";
-
- // consider: typeof null === object
- }
- if (obj === null) {
- return "null";
- }
-
- var type = Object.prototype.toString.call( obj )
- .match(/^\[object\s(.*)\]$/)[1] || '';
-
- switch (type) {
- case 'Number':
- if (isNaN(obj)) {
- return "nan";
- } else {
- return "number";
- }
- case 'String':
- case 'Boolean':
- case 'Array':
- case 'Date':
- case 'RegExp':
- case 'Function':
- return type.toLowerCase();
- }
- if (typeof obj === "object") {
- return "object";
- }
- return undefined;
- },
-
- push: function(result, actual, expected, message) {
- var details = {
- result: result,
- message: message,
- actual: actual,
- expected: expected
- };
-
- message = escapeHtml(message) || (result ? "okay" : "failed");
- message = '<span class="test-message">' + message + "</span>";
- expected = escapeHtml(QUnit.jsDump.parse(expected));
- actual = escapeHtml(QUnit.jsDump.parse(actual));
- var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
- if (actual != expected) {
- output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
- output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
- }
- if (!result) {
- var source = sourceFromStacktrace();
- if (source) {
- details.source = source;
- output += '<tr class="test-source"><th>Source: </th><td><pre>' + source +'</pre></td></tr>';
- }
- }
- output += "</table>";
-
- QUnit.log(details);
-
- config.current.assertions.push({
- result: !!result,
- message: output
- });
- },
-
- // Logging callbacks; all receive a single argument with the listed properties
- // run test/logs.html for any related changes
- begin: function() {},
- // done: { failed, passed, total, runtime }
- done: function() {},
- // log: { result, actual, expected, message }
- log: function() {},
- // testStart: { name }
- testStart: function() {},
- // testDone: { name, failed, passed, total }
- testDone: function() {},
- // moduleStart: { name }
- moduleStart: function() {},
- // moduleDone: { name, failed, passed, total }
- moduleDone: function() {}
-});
-
-if ( typeof document === "undefined" || document.readyState === "complete" ) {
- config.autorun = true;
-}
-
-addEvent(window, "load", function() {
- QUnit.begin({});
-
- // Initialize the config, saving the execution queue
- var oldconfig = extend({}, config);
- QUnit.init();
- extend(config, oldconfig);
-
- config.blocking = false;
-
- var userAgent = id("qunit-userAgent");
- if ( userAgent ) {
- userAgent.innerHTML = navigator.userAgent;
- }
- var banner = id("qunit-header");
- if ( banner ) {
- var paramsIndex = location.href.lastIndexOf(location.search);
- if ( paramsIndex > -1 ) {
- var mainPageLocation = location.href.slice(0, paramsIndex);
- if ( mainPageLocation == location.href ) {
- banner.innerHTML = '<a href=""> ' + banner.innerHTML + '</a> ';
- } else {
- var testName = decodeURIComponent(location.search.slice(1));
- banner.innerHTML = '<a href="' + mainPageLocation + '">' + banner.innerHTML + '</a> › <a href="">' + testName + '</a>';
- }
- }
- }
-
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- var filter = document.createElement("input");
- filter.type = "checkbox";
- filter.id = "qunit-filter-pass";
- addEvent( filter, "click", function() {
- var ol = document.getElementById("qunit-tests");
- if ( filter.checked ) {
- ol.className = ol.className + " hidepass";
- } else {
- var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
- ol.className = tmp.replace(/ hidepass /, " ");
- }
- if ( defined.sessionStorage ) {
- sessionStorage.setItem("qunit-filter-passed-tests", filter.checked ? "true" : "");
- }
- });
- if ( defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
- filter.checked = true;
- var ol = document.getElementById("qunit-tests");
- ol.className = ol.className + " hidepass";
- }
- toolbar.appendChild( filter );
-
- var label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-pass");
- label.innerHTML = "Hide passed tests";
- toolbar.appendChild( label );
- }
-
- var main = id('main') || id('qunit-fixture');
- if ( main ) {
- config.fixture = main.innerHTML;
- }
-
- if (config.autostart) {
- QUnit.start();
- }
-});
-
-function done() {
- config.autorun = true;
-
- // Log the last module results
- if ( config.currentModule ) {
- QUnit.moduleDone( {
- name: config.currentModule,
- failed: config.moduleStats.bad,
- passed: config.moduleStats.all - config.moduleStats.bad,
- total: config.moduleStats.all
- } );
- }
-
- var banner = id("qunit-banner"),
- tests = id("qunit-tests"),
- runtime = +new Date - config.started,
- passed = config.stats.all - config.stats.bad,
- html = [
- 'Tests completed in ',
- runtime,
- ' milliseconds.<br/>',
- '<span class="passed">',
- passed,
- '</span> tests of <span class="total">',
- config.stats.all,
- '</span> passed, <span class="failed">',
- config.stats.bad,
- '</span> failed.'
- ].join('');
-
- if ( banner ) {
- banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
- }
-
- if ( tests ) {
- id( "qunit-testresult" ).innerHTML = html;
- }
-
- QUnit.done( {
- failed: config.stats.bad,
- passed: passed,
- total: config.stats.all,
- runtime: runtime
- } );
-}
-
-function validTest( name ) {
- var i = config.filters.length,
- run = false;
-
- if ( !i ) {
- return true;
- }
-
- while ( i-- ) {
- var filter = config.filters[i],
- not = filter.charAt(0) == '!';
-
- if ( not ) {
- filter = filter.slice(1);
- }
-
- if ( name.indexOf(filter) !== -1 ) {
- return !not;
- }
-
- if ( not ) {
- run = true;
- }
- }
-
- return run;
-}
-
-// so far supports only Firefox, Chrome and Opera (buggy)
-// could be extended in the future to use something like https://github.com/csnover/TraceKit
-function sourceFromStacktrace() {
- try {
- throw new Error();
- } catch ( e ) {
- if (e.stacktrace) {
- // Opera
- return e.stacktrace.split("\n")[6];
- } else if (e.stack) {
- // Firefox, Chrome
- return e.stack.split("\n")[4];
- }
- }
-}
-
-function escapeHtml(s) {
- if (!s) {
- return "";
- }
- s = s + "";
- return s.replace(/[\&"<>\\]/g, function(s) {
- switch(s) {
- case "&": return "&";
- case "\\": return "\\\\";
- case '"': return '\"';
- case "<": return "<";
- case ">": return ">";
- default: return s;
- }
- });
-}
-
-function synchronize( callback ) {
- config.queue.push( callback );
-
- if ( config.autorun && !config.blocking ) {
- process();
- }
-}
-
-function process() {
- var start = (new Date()).getTime();
-
- while ( config.queue.length && !config.blocking ) {
- if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
- config.queue.shift()();
- } else {
- window.setTimeout( process, 13 );
- break;
- }
- }
- if (!config.blocking && !config.queue.length) {
- done();
- }
-}
-
-function saveGlobal() {
- config.pollution = [];
-
- if ( config.noglobals ) {
- for ( var key in window ) {
- config.pollution.push( key );
- }
- }
-}
-
-function checkPollution( name ) {
- var old = config.pollution;
- saveGlobal();
-
- var newGlobals = diff( old, config.pollution );
- if ( newGlobals.length > 0 ) {
- ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
- config.current.expected++;
- }
-
- var deletedGlobals = diff( config.pollution, old );
- if ( deletedGlobals.length > 0 ) {
- ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
- config.current.expected++;
- }
-}
-
-// returns a new Array with the elements that are in a but not in b
-function diff( a, b ) {
- var result = a.slice();
- for ( var i = 0; i < result.length; i++ ) {
- for ( var j = 0; j < b.length; j++ ) {
- if ( result[i] === b[j] ) {
- result.splice(i, 1);
- i--;
- break;
- }
- }
- }
- return result;
-}
-
-function fail(message, exception, callback) {
- if ( typeof console !== "undefined" && console.error && console.warn ) {
- console.error(message);
- console.error(exception);
- console.warn(callback.toString());
-
- } else if ( window.opera && opera.postError ) {
- opera.postError(message, exception, callback.toString);
- }
-}
-
-function extend(a, b) {
- for ( var prop in b ) {
- a[prop] = b[prop];
- }
-
- return a;
-}
-
-function addEvent(elem, type, fn) {
- if ( elem.addEventListener ) {
- elem.addEventListener( type, fn, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, fn );
- } else {
- fn();
- }
-}
-
-function id(name) {
- return !!(typeof document !== "undefined" && document && document.getElementById) &&
- document.getElementById( name );
-}
-
-// Test for equality any JavaScript type.
-// Discussions and reference: http://philrathe.com/articles/equiv
-// Test suites: http://philrathe.com/tests/equiv
-// Author: Philippe Rathé <prathe@gmail.com>
-QUnit.equiv = function () {
-
- var innerEquiv; // the real equiv function
- var callers = []; // stack to decide between skip/abort functions
- var parents = []; // stack to avoiding loops from circular referencing
-
- // Call the o related callback with the given arguments.
- function bindCallbacks(o, callbacks, args) {
- var prop = QUnit.objectType(o);
- if (prop) {
- if (QUnit.objectType(callbacks[prop]) === "function") {
- return callbacks[prop].apply(callbacks, args);
- } else {
- return callbacks[prop]; // or undefined
- }
- }
- }
-
- var callbacks = function () {
-
- // for string, boolean, number and null
- function useStrictEquality(b, a) {
- if (b instanceof a.constructor || a instanceof b.constructor) {
- // to catch short annotaion VS 'new' annotation of a declaration
- // e.g. var i = 1;
- // var j = new Number(1);
- return a == b;
- } else {
- return a === b;
- }
- }
-
- return {
- "string": useStrictEquality,
- "boolean": useStrictEquality,
- "number": useStrictEquality,
- "null": useStrictEquality,
- "undefined": useStrictEquality,
-
- "nan": function (b) {
- return isNaN(b);
- },
-
- "date": function (b, a) {
- return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf();
- },
-
- "regexp": function (b, a) {
- return QUnit.objectType(b) === "regexp" &&
- a.source === b.source && // the regex itself
- a.global === b.global && // and its modifers (gmi) ...
- a.ignoreCase === b.ignoreCase &&
- a.multiline === b.multiline;
- },
-
- // - skip when the property is a method of an instance (OOP)
- // - abort otherwise,
- // initial === would have catch identical references anyway
- "function": function () {
- var caller = callers[callers.length - 1];
- return caller !== Object &&
- typeof caller !== "undefined";
- },
-
- "array": function (b, a) {
- var i, j, loop;
- var len;
-
- // b could be an object literal here
- if ( ! (QUnit.objectType(b) === "array")) {
- return false;
- }
-
- len = a.length;
- if (len !== b.length) { // safe and faster
- return false;
- }
-
- //track reference to avoid circular references
- parents.push(a);
- for (i = 0; i < len; i++) {
- loop = false;
- for(j=0;j<parents.length;j++){
- if(parents[j] === a[i]){
- loop = true;//dont rewalk array
- }
- }
- if (!loop && ! innerEquiv(a[i], b[i])) {
- parents.pop();
- return false;
- }
- }
- parents.pop();
- return true;
- },
-
- "object": function (b, a) {
- var i, j, loop;
- var eq = true; // unless we can proove it
- var aProperties = [], bProperties = []; // collection of strings
-
- // comparing constructors is more strict than using instanceof
- if ( a.constructor !== b.constructor) {
- return false;
- }
-
- // stack constructor before traversing properties
- callers.push(a.constructor);
- //track reference to avoid circular references
- parents.push(a);
-
- for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
- loop = false;
- for(j=0;j<parents.length;j++){
- if(parents[j] === a[i])
- loop = true; //don't go down the same path twice
- }
- aProperties.push(i); // collect a's properties
-
- if (!loop && ! innerEquiv(a[i], b[i])) {
- eq = false;
- break;
- }
- }
-
- callers.pop(); // unstack, we are done
- parents.pop();
-
- for (i in b) {
- bProperties.push(i); // collect b's properties
- }
-
- // Ensures identical properties name
- return eq && innerEquiv(aProperties.sort(), bProperties.sort());
- }
- };
- }();
-
- innerEquiv = function () { // can take multiple arguments
- var args = Array.prototype.slice.apply(arguments);
- if (args.length < 2) {
- return true; // end transition
- }
-
- return (function (a, b) {
- if (a === b) {
- return true; // catch the most you can
- } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || QUnit.objectType(a) !== QUnit.objectType(b)) {
- return false; // don't lose time with error prone cases
- } else {
- return bindCallbacks(a, callbacks, [b, a]);
- }
-
- // apply transition with (1..n) arguments
- })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
- };
-
- return innerEquiv;
-
-}();
-
-/**
- * jsDump
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
- * Date: 5/15/2008
- * @projectDescription Advanced and extensible data dumping for Javascript.
- * @version 1.0.0
- * @author Ariel Flesler
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
- */
-QUnit.jsDump = (function() {
- function quote( str ) {
- return '"' + str.toString().replace(/"/g, '\\"') + '"';
- };
- function literal( o ) {
- return o + '';
- };
- function join( pre, arr, post ) {
- var s = jsDump.separator(),
- base = jsDump.indent(),
- inner = jsDump.indent(1);
- if ( arr.join )
- arr = arr.join( ',' + s + inner );
- if ( !arr )
- return pre + post;
- return [ pre, inner + arr, base + post ].join(s);
- };
- function array( arr ) {
- var i = arr.length, ret = Array(i);
- this.up();
- while ( i-- )
- ret[i] = this.parse( arr[i] );
- this.down();
- return join( '[', ret, ']' );
- };
-
- var reName = /^function (\w+)/;
-
- var jsDump = {
- parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
- var parser = this.parsers[ type || this.typeOf(obj) ];
- type = typeof parser;
-
- return type == 'function' ? parser.call( this, obj ) :
- type == 'string' ? parser :
- this.parsers.error;
- },
- typeOf:function( obj ) {
- var type;
- if ( obj === null ) {
- type = "null";
- } else if (typeof obj === "undefined") {
- type = "undefined";
- } else if (QUnit.is("RegExp", obj)) {
- type = "regexp";
- } else if (QUnit.is("Date", obj)) {
- type = "date";
- } else if (QUnit.is("Function", obj)) {
- type = "function";
- } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
- type = "window";
- } else if (obj.nodeType === 9) {
- type = "document";
- } else if (obj.nodeType) {
- type = "node";
- } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) {
- type = "array";
- } else {
- type = typeof obj;
- }
- return type;
- },
- separator:function() {
- return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' ';
- },
- indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
- if ( !this.multiline )
- return '';
- var chr = this.indentChar;
- if ( this.HTML )
- chr = chr.replace(/\t/g,' ').replace(/ /g,' ');
- return Array( this._depth_ + (extra||0) ).join(chr);
- },
- up:function( a ) {
- this._depth_ += a || 1;
- },
- down:function( a ) {
- this._depth_ -= a || 1;
- },
- setParser:function( name, parser ) {
- this.parsers[name] = parser;
- },
- // The next 3 are exposed so you can use them
- quote:quote,
- literal:literal,
- join:join,
- //
- _depth_: 1,
- // This is the list of parsers, to modify them, use jsDump.setParser
- parsers:{
- window: '[Window]',
- document: '[Document]',
- error:'[ERROR]', //when no parser is found, shouldn't happen
- unknown: '[Unknown]',
- 'null':'null',
- 'undefined':'undefined',
- 'function':function( fn ) {
- var ret = 'function',
- name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
- if ( name )
- ret += ' ' + name;
- ret += '(';
-
- ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
- return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
- },
- array: array,
- nodelist: array,
- arguments: array,
- object:function( map ) {
- var ret = [ ];
- QUnit.jsDump.up();
- for ( var key in map )
- ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(map[key]) );
- QUnit.jsDump.down();
- return join( '{', ret, '}' );
- },
- node:function( node ) {
- var open = QUnit.jsDump.HTML ? '<' : '<',
- close = QUnit.jsDump.HTML ? '>' : '>';
-
- var tag = node.nodeName.toLowerCase(),
- ret = open + tag;
-
- for ( var a in QUnit.jsDump.DOMAttrs ) {
- var val = node[QUnit.jsDump.DOMAttrs[a]];
- if ( val )
- ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
- }
- return ret + close + open + '/' + tag + close;
- },
- functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
- var l = fn.length;
- if ( !l ) return '';
-
- var args = Array(l);
- while ( l-- )
- args[l] = String.fromCharCode(97+l);//97 is 'a'
- return ' ' + args.join(', ') + ' ';
- },
- key:quote, //object calls it internally, the key part of an item in a map
- functionCode:'[code]', //function calls it internally, it's the content of the function
- attribute:quote, //node calls it internally, it's an html attribute value
- string:quote,
- date:quote,
- regexp:literal, //regex
- number:literal,
- 'boolean':literal
- },
- DOMAttrs:{//attributes to dump from nodes, name=>realName
- id:'id',
- name:'name',
- 'class':'className'
- },
- HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
- indentChar:' ',//indentation unit
- multiline:true //if true, items in a collection, are separated by a \n, else just a space.
- };
-
- return jsDump;
-})();
-
-// from Sizzle.js
-function getText( elems ) {
- var ret = "", elem;
-
- for ( var i = 0; elems[i]; i++ ) {
- elem = elems[i];
-
- // Get the text from text nodes and CDATA nodes
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
- ret += elem.nodeValue;
-
- // Traverse everything else, except comment nodes
- } else if ( elem.nodeType !== 8 ) {
- ret += getText( elem.childNodes );
- }
- }
-
- return ret;
-};
-
-/*
- * Javascript Diff Algorithm
- * By John Resig (http://ejohn.org/)
- * Modified by Chu Alan "sprite"
- *
- * Released under the MIT license.
- *
- * More Info:
- * http://ejohn.org/projects/javascript-diff-algorithm/
- *
- * Usage: QUnit.diff(expected, actual)
- *
- * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
- */
-QUnit.diff = (function() {
- function diff(o, n){
- var ns = new Object();
- var os = new Object();
-
- for (var i = 0; i < n.length; i++) {
- if (ns[n[i]] == null)
- ns[n[i]] = {
- rows: new Array(),
- o: null
- };
- ns[n[i]].rows.push(i);
- }
-
- for (var i = 0; i < o.length; i++) {
- if (os[o[i]] == null)
- os[o[i]] = {
- rows: new Array(),
- n: null
- };
- os[o[i]].rows.push(i);
- }
-
- for (var i in ns) {
- if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
- n[ns[i].rows[0]] = {
- text: n[ns[i].rows[0]],
- row: os[i].rows[0]
- };
- o[os[i].rows[0]] = {
- text: o[os[i].rows[0]],
- row: ns[i].rows[0]
- };
- }
- }
-
- for (var i = 0; i < n.length - 1; i++) {
- if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
- n[i + 1] == o[n[i].row + 1]) {
- n[i + 1] = {
- text: n[i + 1],
- row: n[i].row + 1
- };
- o[n[i].row + 1] = {
- text: o[n[i].row + 1],
- row: i + 1
- };
- }
- }
-
- for (var i = n.length - 1; i > 0; i--) {
- if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
- n[i - 1] == o[n[i].row - 1]) {
- n[i - 1] = {
- text: n[i - 1],
- row: n[i].row - 1
- };
- o[n[i].row - 1] = {
- text: o[n[i].row - 1],
- row: i - 1
- };
- }
- }
-
- return {
- o: o,
- n: n
- };
- }
-
- return function(o, n){
- o = o.replace(/\s+$/, '');
- n = n.replace(/\s+$/, '');
- var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
-
- var str = "";
-
- var oSpace = o.match(/\s+/g);
- if (oSpace == null) {
- oSpace = [" "];
- }
- else {
- oSpace.push(" ");
- }
- var nSpace = n.match(/\s+/g);
- if (nSpace == null) {
- nSpace = [" "];
- }
- else {
- nSpace.push(" ");
- }
-
- if (out.n.length == 0) {
- for (var i = 0; i < out.o.length; i++) {
- str += '<del>' + out.o[i] + oSpace[i] + "</del>";
- }
- }
- else {
- if (out.n[0].text == null) {
- for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
- str += '<del>' + out.o[n] + oSpace[n] + "</del>";
- }
- }
-
- for (var i = 0; i < out.n.length; i++) {
- if (out.n[i].text == null) {
- str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
- }
- else {
- var pre = "";
-
- for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
- pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
- }
- str += " " + out.n[i].text + nSpace[i] + pre;
- }
- }
- }
-
- return str;
- };
-})();
-
-})(this);(function() {
-
-/**************************************************
- Node
- *************************************************/
-
-var moment;
-if (typeof window === 'undefined') {
- moment = require('../../moment');
- module = QUnit.module;
-} else {
- moment = window.moment;
-}
-
-/**************************************************
- Tests
- *************************************************/
-
-
-module("create");
-
-
-test("array", 8, function() {
- ok(moment([2010]).native() instanceof Date, "[2010]");
- ok(moment([2010, 1]).native() instanceof Date, "[2010, 1]");
- ok(moment([2010, 1, 12]).native() instanceof Date, "[2010, 1, 12]");
- ok(moment([2010, 1, 12, 1]).native() instanceof Date, "[2010, 1, 12, 1]");
- ok(moment([2010, 1, 12, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1]");
- ok(moment([2010, 1, 12, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1]");
- ok(moment([2010, 1, 12, 1, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1, 1]");
- deepEqual(moment(new Date(2010, 1, 14, 15, 25, 50, 125)), moment([2010, 1, 14, 15, 25, 50, 125]), "constructing with array === constructing with new Date()");
-});
-
-
-test("number", 2, function() {
- ok(moment(1000).native() instanceof Date, "1000");
- ok((moment(1000).valueOf() === 1000), "testing valueOf");
-});
-
-
-test("date", 1, function() {
- ok(moment(new Date()).native() instanceof Date, "new Date()");
-});
-
-test("moment", 2, function() {
- ok(moment(moment()).native() instanceof Date, "moment(moment())");
- ok(moment(moment(moment())).native() instanceof Date, "moment(moment(moment()))");
-});
-
-test("undefined", 1, function() {
- ok(moment().native() instanceof Date, "undefined");
-});
-
-
-test("string without format", 2, function() {
- ok(moment("Aug 9, 1995").native() instanceof Date, "Aug 9, 1995");
- ok(moment("Mon, 25 Dec 1995 13:30:00 GMT").native() instanceof Date, "Mon, 25 Dec 1995 13:30:00 GMT");
-});
-
-test("string without format - json", 4, function() {
- equal(moment("Date(1325132654000)").valueOf(), 1325132654000, "Date(1325132654000)");
- equal(moment("/Date(1325132654000)/").valueOf(), 1325132654000, "/Date(1325132654000)/");
- equal(moment("/Date(1325132654000+0700)/").valueOf(), 1325132654000, "/Date(1325132654000+0700)/");
- equal(moment("/Date(1325132654000-0700)/").valueOf(), 1325132654000, "/Date(1325132654000-0700)/");
-});
-
-test("string with format", 23, function() {
- moment.lang('en');
- var a = [
- ['MM-DD-YYYY', '12-02-1999'],
- ['DD-MM-YYYY', '12-02-1999'],
- ['DD/MM/YYYY', '12/02/1999'],
- ['DD_MM_YYYY', '12_02_1999'],
- ['DD:MM:YYYY', '12:02:1999'],
- ['D-M-YY', '2-2-99'],
- ['YY', '99'],
- ['DDD-YYYY', '300-1999'],
- ['DD-MM-YYYY h:m:s', '12-02-1999 2:45:10'],
- ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 am'],
- ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 pm'],
- ['h:mm a', '12:00 pm'],
- ['h:mm a', '12:30 pm'],
- ['h:mm a', '12:00 am'],
- ['h:mm a', '12:30 am'],
- ['HH:mm', '12:00'],
- ['YYYY-MM-DDTHH:mm:ss', '2011-11-11T11:11:11'],
- ['MM-DD-YYYY \\M', '12-02-1999 M'],
- ['ddd MMM DD HH:mm:ss YYYY', 'Tue Apr 07 22:52:51 2009'],
- ['HH:mm:ss', '12:00:00'],
- ['HH:mm:ss', '12:30:00'],
- ['HH:mm:ss', '00:00:00'],
- ['HH:mm:ss', '00:30:00']
- ],
- i;
- for (i = 0; i < a.length; i++) {
- equal(moment(a[i][1], a[i][0]).format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("string with format (timezone)", 8, function() {
- equal(moment('5 -0700', 'H ZZ').native().getUTCHours(), 12, 'parse hours "5 -0700" ---> "H ZZ"');
- equal(moment('5 -07:00', 'H Z').native().getUTCHours(), 12, 'parse hours "5 -07:00" ---> "H Z"');
- equal(moment('5 -0730', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 -0730" ---> "H ZZ"');
- equal(moment('5 -07:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 -07:30" ---> "H Z"');
- equal(moment('5 +0100', 'H ZZ').native().getUTCHours(), 4, 'parse hours "5 +0100" ---> "H ZZ"');
- equal(moment('5 +01:00', 'H Z').native().getUTCHours(), 4, 'parse hours "5 +01:00" ---> "H Z"');
- equal(moment('5 +0130', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 +0130" ---> "H ZZ"');
- equal(moment('5 +01:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 +01:30" ---> "H Z"');
-});
-
-test("string with format (timezone offset)", 3, function() {
- var a = new Date(Date.UTC(2011, 0, 1, 1));
- var b = moment('2011 1 1 0 -01:00', 'YYYY MM DD HH Z');
- equal(a.getHours(), b.hours(), 'date created with utc == parsed string with timezone offset');
- equal(+a, +b, 'date created with utc == parsed string with timezone offset');
- var c = moment('2011 2 1 10 -05:00', 'YYYY MM DD HH Z');
- var d = moment('2011 2 1 8 -07:00', 'YYYY MM DD HH Z');
- equal(c.hours(), d.hours(), '10 am central time == 8 am pacific time');
-});
-
-test("string with array of formats", 3, function() {
- equal(moment('13-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '02 13 1999', 'switching month and day');
- equal(moment('02-13-1999', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year last');
- equal(moment('1999-02-13', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year first');
-});
-
-test("string with format - years", 2, function() {
- equal(moment('71', 'YY').format('YYYY'), '1971', '71 > 1971');
- equal(moment('69', 'YY').format('YYYY'), '2069', '69 > 2069');
-});
-
-test("implicit cloning", 2, function() {
- var momentA = moment([2011, 10, 10]);
- var momentB = moment(momentA);
- momentA.month(5);
- equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
- equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
-});
-
-test("explicit cloning", 2, function() {
- var momentA = moment([2011, 10, 10]);
- var momentB = momentA.clone();
- momentA.month(5);
- equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
- equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
-});
-
-module("add and subtract");
-
-
-test("add and subtract short", 12, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add({ms:50}).milliseconds(), 550, 'Add milliseconds');
- equal(a.add({s:1}).seconds(), 9, 'Add seconds');
- equal(a.add({m:1}).minutes(), 8, 'Add minutes');
- equal(a.add({h:1}).hours(), 7, 'Add hours');
- equal(a.add({d:1}).date(), 13, 'Add date');
- equal(a.add({w:1}).date(), 20, 'Add week');
- equal(a.add({M:1}).month(), 10, 'Add month');
- equal(a.add({y:1}).year(), 2012, 'Add year');
-
- var b = moment([2010, 0, 31]).add({M:1});
- var c = moment([2010, 1, 28]).subtract({M:1});
-
- equal(b.month(), 1, 'add month, jan 31st to feb 28th');
- equal(b.date(), 28, 'add month, jan 31st to feb 28th');
- equal(c.month(), 0, 'subtract month, feb 28th to jan 28th');
- equal(c.date(), 28, 'subtract month, feb 28th to jan 28th');
-});
-
-test("add and subtract long", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add({milliseconds:50}).milliseconds(), 550, 'Add milliseconds');
- equal(a.add({seconds:1}).seconds(), 9, 'Add seconds');
- equal(a.add({minutes:1}).minutes(), 8, 'Add minutes');
- equal(a.add({hours:1}).hours(), 7, 'Add hours');
- equal(a.add({days:1}).date(), 13, 'Add date');
- equal(a.add({weeks:1}).date(), 20, 'Add week');
- equal(a.add({months:1}).month(), 10, 'Add month');
- equal(a.add({years:1}).year(), 2012, 'Add year');
-});
-
-test("add and subtract string short", 9, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- var b = a.clone();
-
- equal(a.add('milliseconds', 50).milliseconds(), 550, 'Add milliseconds');
- equal(a.add('seconds', 1).seconds(), 9, 'Add seconds');
- equal(a.add('minutes', 1).minutes(), 8, 'Add minutes');
- equal(a.add('hours', 1).hours(), 7, 'Add hours');
- equal(a.add('days', 1).date(), 13, 'Add date');
- equal(a.add('weeks', 1).date(), 20, 'Add week');
- equal(a.add('months', 1).month(), 10, 'Add month');
- equal(a.add('years', 1).year(), 2012, 'Add year');
- equal(b.add('days', '01').date(), 13, 'Add date');
-});
-
-test("add and subtract string short", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add('ms', 50).milliseconds(), 550, 'Add milliseconds');
- equal(a.add('s', 1).seconds(), 9, 'Add seconds');
- equal(a.add('m', 1).minutes(), 8, 'Add minutes');
- equal(a.add('h', 1).hours(), 7, 'Add hours');
- equal(a.add('d', 1).date(), 13, 'Add date');
- equal(a.add('w', 1).date(), 20, 'Add week');
- equal(a.add('M', 1).month(), 10, 'Add month');
- equal(a.add('y', 1).year(), 2012, 'Add year');
-});
-
-test("adding across DST", 3, function(){
- var a = moment(new Date(2011, 2, 12, 5, 0, 0));
- var b = moment(new Date(2011, 2, 12, 5, 0, 0));
- var c = moment(new Date(2011, 2, 12, 5, 0, 0));
- var d = moment(new Date(2011, 2, 12, 5, 0, 0));
- a.add('days', 1);
- b.add('hours', 24);
- c.add('months', 1);
- equal(a.hours(), 5, 'adding days over DST difference should result in the same hour');
- if (b.isDST() && !d.isDST()) {
- equal(b.hours(), 6, 'adding hours over DST difference should result in a different hour');
- } else {
- equal(b.hours(), 5, 'adding hours over DST difference should result in a same hour if the timezone does not have daylight savings time');
- }
- equal(c.hours(), 5, 'adding months over DST difference should result in the same hour');
-});
-
-module("diff");
-
-
-test("diff", 5, function() {
- equal(moment(1000).diff(0), 1000, "1 second - 0 = 1000");
- equal(moment(1000).diff(500), 500, "1 second - .5 second = -500");
- equal(moment(0).diff(1000), -1000, "0 - 1 second = -1000");
- equal(moment(new Date(1000)).diff(1000), 0, "1 second - 1 second = 0");
- var oneHourDate = new Date(),
- nowDate = new Date();
- oneHourDate.setHours(oneHourDate.getHours() + 1);
- equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, "1 hour from now = 360000");
-});
-
-test("diff key after", 9, function() {
- equal(moment([2010]).diff([2011], 'years'), -1, "year diff");
- equal(moment([2010]).diff([2011, 6], 'years', true), -1.5, "year diff, float");
- equal(moment([2010]).diff([2010, 2], 'months'), -2, "month diff");
- equal(moment([2010]).diff([2010, 0, 7], 'weeks'), -1, "week diff");
- equal(moment([2010]).diff([2010, 0, 21], 'weeks'), -3, "week diff");
- equal(moment([2010]).diff([2010, 0, 4], 'days'), -3, "day diff");
- equal(moment([2010]).diff([2010, 0, 1, 4], 'hours'), -4, "hour diff");
- equal(moment([2010]).diff([2010, 0, 1, 0, 5], 'minutes'), -5, "minute diff");
- equal(moment([2010]).diff([2010, 0, 1, 0, 0, 6], 'seconds'), -6, "second diff");
-});
-
-test("diff key before", 9, function() {
- equal(moment([2011]).diff([2010], 'years'), 1, "year diff");
- equal(moment([2011, 6]).diff([2010], 'years', true), 1.5, "year diff, float");
- equal(moment([2010, 2]).diff([2010], 'months'), 2, "month diff");
- equal(moment([2010, 0, 4]).diff([2010], 'days'), 3, "day diff");
- equal(moment([2010, 0, 7]).diff([2010], 'weeks'), 1, "week diff");
- equal(moment([2010, 0, 21]).diff([2010], 'weeks'), 3, "week diff");
- equal(moment([2010, 0, 1, 4]).diff([2010], 'hours'), 4, "hour diff");
- equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minutes'), 5, "minute diff");
- equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'seconds'), 6, "second diff");
-});
-
-test("diff month", 1, function() {
- equal(moment([2011, 0, 31]).diff([2011, 2, 1], 'months'), -1, "month diff");
-});
-
-test("diff across DST", 2, function() {
- equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'weeks', true), 2, "diff weeks across DST");
- equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'days', true), 14, "diff weeks across DST");
-});
-
-test("diff overflow", 4, function() {
- equal(moment([2011]).diff([2010], 'months'), 12, "month diff");
- equal(moment([2010, 0, 2]).diff([2010], 'hours'), 24, "hour diff");
- equal(moment([2010, 0, 1, 2]).diff([2010], 'minutes'), 120, "minute diff");
- equal(moment([2010, 0, 1, 0, 4]).diff([2010], 'seconds'), 240, "second diff");
-});
-
-
-module("leap year");
-
-
-test("leap year", 4, function() {
- equal(moment([2010, 0, 1]).isLeapYear(), false, '2010');
- equal(moment([2100, 0, 1]).isLeapYear(), false, '2100');
- equal(moment([2008, 0, 1]).isLeapYear(), true, '2008');
- equal(moment([2000, 0, 1]).isLeapYear(), true, '2000');
-});
-
-
-module("getters and setters");
-
-
-test("getters", 8, function() {
- var a = moment([2011, 9, 12, 6, 7, 8, 9]);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
- equal(a.milliseconds(), 9, 'milliseconds');
-});
-
-test("setters", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(9);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
- equal(a.milliseconds(), 9, 'milliseconds');
-});
-
-test("setters - falsey values", 1, function() {
- var a = moment();
- // ensure minutes wasn't coincidentally 0 already
- a.minutes(1);
- a.minutes(0);
- equal(a.minutes(), 0, 'falsey value');
-});
-
-test("chaining setters", 7, function() {
- var a = moment();
- a.year(2011)
- .month(9)
- .date(12)
- .hours(6)
- .minutes(7)
- .seconds(8);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
-});
-
-test("day setter", 18, function() {
- var a = moment([2011, 0, 15]);
- equal(moment(a).day(0).date(), 9, 'set from saturday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from saturday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from saturday to wednesday');
-
- a = moment([2011, 0, 9]);
- equal(moment(a).day(0).date(), 9, 'set from sunday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from sunday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from sunday to wednesday');
-
- a = moment([2011, 0, 12]);
- equal(moment(a).day(0).date(), 9, 'set from wednesday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from wednesday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from wednesday to wednesday');
-
- equal(moment(a).day(-7).date(), 2, 'set from wednesday to last sunday');
- equal(moment(a).day(-1).date(), 8, 'set from wednesday to last saturday');
- equal(moment(a).day(-4).date(), 5, 'set from wednesday to last wednesday');
-
- equal(moment(a).day(7).date(), 16, 'set from wednesday to next sunday');
- equal(moment(a).day(13).date(), 22, 'set from wednesday to next saturday');
- equal(moment(a).day(10).date(), 19, 'set from wednesday to next wednesday');
-
- equal(moment(a).day(14).date(), 23, 'set from wednesday to second next sunday');
- equal(moment(a).day(20).date(), 29, 'set from wednesday to second next saturday');
- equal(moment(a).day(17).date(), 26, 'set from wednesday to second next wednesday');
-});
-
-
-module("format");
-
-
-test("format YY", 1, function() {
- var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
- equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format escape brackets", 5, function() {
- var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
- equal(b.format('[day]'), 'day', 'Single bracket');
- equal(b.format('[day] YY [YY]'), 'day 09 YY', 'Double bracket');
- equal(b.format('[YY'), '[09', 'Un-ended bracket');
- equal(b.format('[[YY]]'), '[YY]', 'Double nested brackets');
- equal(b.format('[[]'), '[', 'Escape open bracket');
-});
-
-test("format timezone", 4, function() {
- var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
- ok(b.format('z').match(/^[A-Z]{3,5}$/), b.format('z') + ' ---> Something like "PST"');
- ok(b.format('zz').match(/^[A-Z]{3,5}$/), b.format('zz') + ' ---> Something like "PST"');
- ok(b.format('Z').match(/^[\+\-]\d\d:\d\d$/), b.format('Z') + ' ---> Something like "+07:30"');
- ok(b.format('ZZ').match(/^[\+\-]\d{4}$/), b.format('ZZ') + ' ---> Something like "+0700"');
-});
-
-test("format multiple with zone", 1, function() {
- var b = moment('2012-10-08 -1200', ['YYYY ZZ', 'YYYY-MM-DD ZZ']);
- equals(b.format('YYYY-MM'), '2012-10', 'Parsing multiple formats should not crash with different sized formats');
-});
-
-test("isDST", 2, function() {
- var janOffset = new Date(2011, 0, 1).getTimezoneOffset(),
- julOffset = new Date(2011, 6, 1).getTimezoneOffset(),
- janIsDst = janOffset < julOffset,
- julIsDst = julOffset < janOffset,
- jan1 = moment([2011]),
- jul1 = moment([2011, 6]);
-
- if (janIsDst && julIsDst) {
- ok(0, 'January and July cannot both be in DST');
- ok(0, 'January and July cannot both be in DST');
- } else if (janIsDst) {
- ok(jan1.isDST(), 'January 1 is DST');
- ok(!jul1.isDST(), 'July 1 is not DST');
- } else if (julIsDst) {
- ok(!jan1.isDST(), 'January 1 is not DST');
- ok(jul1.isDST(), 'July 1 is DST');
- } else {
- ok(!jan1.isDST(), 'January 1 is not DST');
- ok(!jul1.isDST(), 'July 1 is not DST');
- }
-});
-
-test("zone", 3, function() {
- if (moment().zone() > 0) {
- ok(moment().format('ZZ').indexOf('-') > -1, 'When the zone() offset is greater than 0, the ISO offset should be less than zero');
- }
- if (moment().zone() < 0) {
- ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is less than 0, the ISO offset should be greater than zero');
- }
- if (moment().zone() == 0) {
- ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero');
- }
- ok(moment().zone() % 30 === 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
- equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset');
-});
-
-module("sod");
-
-test("sod", 7, function(){
- var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).sod();
- equal(m.year(), 2011, "keep the year");
- equal(m.month(), 1, "keep the month");
- equal(m.date(), 2, "keep the day");
- equal(m.hours(), 0, "strip out the hours");
- equal(m.minutes(), 0, "strip out the minutes");
- equal(m.seconds(), 0, "strip out the seconds");
- equal(m.milliseconds(), 0, "strip out the milliseconds");
-});
-
-module("eod");
-
-test("eod", 7, function(){
- var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).eod();
- equal(m.year(), 2011, "keep the year");
- equal(m.month(), 1, "keep the month");
- equal(m.date(), 2, "keep the day");
- equal(m.hours(), 23, "set the hours");
- equal(m.minutes(), 59, "set the minutes");
- equal(m.seconds(), 59, "set the seconds");
- equal(m.milliseconds(), 999, "set the seconds");
-});
-
-
-})();
-
-(function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }
-/**************************************************
- Català
- *************************************************/
-
-module("lang:ca");
-
-test("parse", 96, function() {
- moment.lang('ca');
-
- var tests = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ca');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('ca');
- var expected = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ca');
- var expected = "Diumenge Dg._Dilluns Dl._Dimarts Dt._Dimecres Dc._Dijous Dj._Divendres Dv._Dissabte Ds.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ca');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segons", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuts", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuts", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hores", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hores", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hores", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dies", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dies", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dies", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesos", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesos", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesos", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesos", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesos", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un any", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un any", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anys", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un any", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anys", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ca');
- equal(moment(30000).from(0), "en uns segons", "prefix");
- equal(moment(0).from(30000), "fa uns segons", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('ca');
- equal(moment().fromNow(), "fa uns segons", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('ca');
- equal(moment().add({s:30}).fromNow(), "en uns segons", "en uns segons");
- equal(moment().add({d:5}).fromNow(), "en 5 dies", "en 5 dies");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('ca');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "avui a les 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "avui a les 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "avui a les 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "demá a les 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "demá a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "avui a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ahir a les 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ca');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ca');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ca');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- German
- *************************************************/
-
-module("lang:de");
-
-test("parse", 96, function() {
- moment.lang('de');
- var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('de');
- var a = [
- ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],
- ['ddd, hA', 'So., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. Sonntag So.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14. Februar 2010'],
- ['LLL', '14. Februar 2010 15:25 Uhr'],
- ['LLLL', 'Sonntag, 14. Februar 2010 15:25 Uhr']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('de');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('de');
- var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('de');
- var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('de');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('de');
- equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
- equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('de');
- equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('de');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Heute um 2:00 Uhr", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Heute um 2:25 Uhr", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Heute um 3:00 Uhr", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 2:00 Uhr", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 1:00 Uhr", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 2:00 Uhr", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('de');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('de');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('de');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en");
-
-test("parse", 96, function() {
- moment.lang('en');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '02/14/2010'],
- ['LL', 'February 14 2010'],
- ['LLL', 'February 14 2010 3:25 PM'],
- ['LLLL', 'Sunday, February 14 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('en');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en-gb");
-
-test("parse", 96, function() {
- moment.lang('en-gb');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en-gb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 February 2010'],
- ['LLL', '14 February 2010 3:25 PM'],
- ['LLLL', 'Sunday, 14 February 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en-gb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en-gb');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en-gb');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en-gb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en-gb');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en-gb');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en-gb');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('en-gb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en-gb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en-gb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en-gb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Spanish
- *************************************************/
-
-module("lang:es");
-
-test("parse", 96, function() {
- moment.lang('es');
- var tests = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('es');
- var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('es');
- var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('es');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('es');
- equal(moment(30000).from(0), "en unos segundos", "prefix");
- equal(moment(0).from(30000), "hace unos segundos", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('es');
- equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('es');
- equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('es');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoy a las 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoy a las 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoy a las 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañana a las 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoy a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ayer a las 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('es');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('es');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('es');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Euskara
- *************************************************/
-
-module("lang:eu");
-
-test("parse", 96, function() {
- moment.lang('eu');
- var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('eu');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'ig., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. igandea ig.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '2010ko otsailaren 14a'],
- ['LLL', '2010ko otsailaren 14a 15:25'],
- ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('eu');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('eu');
- var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('eu');
- var expected = 'igandea ig._astelehena al._asteartea ar._asteazkena az._osteguna og._ostirala ol._larunbata lr.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('eu');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundo batzuk", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minutu bat", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minutu bat", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutu", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutu", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "ordu bat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "ordu bat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ordu", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ordu", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ordu", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egun bat", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egun bat", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 egun", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egun bat", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 egun", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 egun", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "hilabete bat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "hilabete bat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "hilabete bat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hilabete", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hilabete", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hilabete", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "hilabete bat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hilabete", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hilabete", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "urte bat", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "urte bat", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 urte", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "urte bat", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 urte", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('eu');
- equal(moment(30000).from(0), "segundo batzuk barru", "prefix");
- equal(moment(0).from(30000), "duela segundo batzuk", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('eu');
- equal(moment().fromNow(), "duela segundo batzuk", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('eu');
- equal(moment().add({s:30}).fromNow(), "segundo batzuk barru", "in seconds");
- equal(moment().add({d:5}).fromNow(), "5 egun barru", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('eu');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "gaur 02:00etan", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "gaur 02:25etan", "now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "gaur 03:00etan", "now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "bihar 02:00etan", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "gaur 01:00etan", "now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "atzo 02:00etan", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('eu');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('eu');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('eu');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- French
- *************************************************/
-
-module("lang:fr");
-
-test("parse", 96, function() {
- moment.lang('fr');
- var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('fr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
- ['ddd, hA', 'dim., 3PM'],
- ['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14ème 14'],
- ['d do dddd ddd', '0 0ème dimanche dim.'],
- ['DDD DDDo DDDD', '45 45ème 045'],
- ['w wo ww', '8 8ème 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 février 2010'],
- ['LLL', '14 février 2010 15:25'],
- ['LLLL', 'dimanche 14 février 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('fr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
- equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
- equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
- equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
- equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
- equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
- equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
- equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
- equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
- equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
- equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
- equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
- equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
- equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
- equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
- equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
- equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
-});
-
-test("format month", 12, function() {
- moment.lang('fr');
- var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('fr');
- var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('fr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('fr');
- equal(moment(30000).from(0), "dans quelques secondes", "prefix");
- equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('fr');
- equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
-});
-
-
-test("same day", 6, function() {
- moment.lang('fr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Ajourd'hui à 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Ajourd'hui à 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Ajourd'hui à 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Ajourd'hui à 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
-});
-
-test("same next week", 15, function() {
- moment.lang('fr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("same last week", 15, function() {
- moment.lang('fr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("same all else", 4, function() {
- moment.lang('fr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Galego
- *************************************************/
-
-module("lang:gl");
-
-test("parse", 96, function() {
- moment.lang('gl');
- var tests = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('gl');
- var expected = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('gl');
- var expected = "Domingo Dom._Luns Lun._Martes Mar._Mércores Mér._Xoves Xov._Venres Ven._Sábado Sáb.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('gl');
- var start = moment([2007, 1, 28]);
-
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segundo", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "unha hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "unha hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('gl');
- equal(moment(30000).from(0), "en uns segundo", "prefix");
- equal(moment(0).from(30000), "fai uns segundo", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('gl');
- equal(moment().fromNow(), "fai uns segundo", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('gl');
- equal(moment().add({s:30}).fromNow(), "en uns segundo", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('gl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoxe ás 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoxe ás 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañá ás 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañá a 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe a 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('gl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('gl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('gl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Italian
- *************************************************/
-
-module("lang:it");
-
-test("parse", 96, function() {
- moment.lang('it');
- var tests = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('it');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, Febbraio 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Febbraio Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domenica Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 Febbraio 2010'],
- ['LLL', '14 Febbraio 2010 15:25'],
- ['LLLL', 'Domenica, 14 Febbraio 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('it');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('it');
- var expected = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('it');
- var expected = 'Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('it');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondi", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuti", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuti", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "un ora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "un ora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ore", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ore", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ore", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un giorno", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un giorno", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 giorni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un giorno", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 giorni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 giorni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mese", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mese", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mese", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesi", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesi", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesi", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mese", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesi", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesi", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un anno", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un anno", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anni", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un anno", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anni", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('it');
- equal(moment(30000).from(0), "in secondi", "prefix");
- equal(moment(0).from(30000), "secondi fa", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('it');
- equal(moment().add({s:30}).fromNow(), "in secondi", "in seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 giorni", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('it');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Oggi alle 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Oggi alle 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Domani alle 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ieri alle 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('it');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('it');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('it');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-
-/**************************************************
- Korean
- *************************************************/
-
-module("lang:kr");
-
-test("format", 18, function() {
- moment.lang('kr');
- var a = [
- ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
- ['ddd A h', '일 오후 3'],
- ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14일 14'],
- ['d do dddd ddd', '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', '2010.02.14'],
- ['LL', '2010년 2월 14일'],
- ['LLL', '2010년 2월 14일 오후 3시 25분'],
- ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('kr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
- equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
- equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
- equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
- equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
- equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
- equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
- equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
- equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
- equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
- equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
- equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
- equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
- equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
- equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
- equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
- equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
- equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
- equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
- equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
- equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
- equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
- equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
- equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
- equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
- equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
- equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
- equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
-});
-
-test("format month", 12, function() {
- moment.lang('kr');
- var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('kr');
- var expected = '일요일 일_월요일 월_화요일 화_수요일 수_목요일 목_금요일 금_토요일 토'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('kr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
-});
-
-test("suffix", 2, function() {
- moment.lang('kr');
- equal(moment(30000).from(0), "몇초 후", "prefix");
- equal(moment(0).from(30000), "몇초 전", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('kr');
- equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('kr');
- equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('kr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('kr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('kr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('kr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-
-/**************************************************
- Norwegian bokmål
- *************************************************/
-
-module("lang:nb");
-
-test("parse", 96, function() {
- moment.lang('nb');
- var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'søn, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 februar feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. søndag søn'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februar 2010'],
- ['LLL', '14 februar 2010 15:25'],
- ['LLLL', 'søndag 14 februar 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('nb');
- var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nb');
- var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nb');
- equal(moment(30000).from(0), "om noen sekunder", "prefix");
- equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nb');
- equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nb');
- equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "I dag klokken 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "I dag klokken 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "I dag klokken 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "I morgen klokken 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokken 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokken 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Dutch
- *************************************************/
-
-module("lang:nl");
-
-test("parse", 96, function() {
- moment.lang('nl');
- var tests = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nl');
- var a = [
- ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'],
- ['ddd, HH', 'zo., 15'],
- ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14de 14'],
- ['d do dddd ddd', '0 0de zondag zo.'],
- ['DDD DDDo DDDD', '45 45ste 045'],
- ['w wo ww', '8 8ste 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ste day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'zondag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
- equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');
- equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');
- equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');
- equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');
- equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');
- equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');
- equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');
- equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');
- equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');
- equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');
- equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');
- equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');
- equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');
- equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');
- equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');
- equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');
-});
-
-test("format month", 12, function() {
- moment.lang('nl');
- var expected = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nl');
- var expected = 'zondag zo._maandag ma._dinsdag di._woensdag wo._donderdag do._vrijdag vr._zaterdag za.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "een paar seconden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "één minuut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "één minuut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "één uur", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "één uur", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 uur", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 uur", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 uur", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "één dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "één dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "één dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "één maand", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "één maand", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "één maand", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 maanden", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 maanden", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 maanden", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "één maand", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 maanden", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 maanden", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "één jaar", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "één jaar", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 jaar", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "één jaar", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaar", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nl');
- equal(moment(30000).from(0), "over een paar seconden", "prefix");
- equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nl');
- equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nl');
- equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Vandaag om 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Vandaag om 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Vandaag om 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen om 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Vandaag om 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gisteren om 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Polish
- *************************************************/
-
-module("lang:pl");
-
-test("parse", 96, function() {
- moment.lang('pl');
- var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pl');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'nie, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 luty lut'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. niedziela nie'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 luty 2010'],
- ['LLL', '14 luty 2010 15:25'],
- ['LLLL', 'niedziela, 14 luty 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('pl');
- var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pl');
- var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pl');
- equal(moment(30000).from(0), "za kilka sekund", "prefix");
- equal(moment(0).from(30000), "kilka sekund temu", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('pl');
- equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
-});
-
-
-test("fromNow", 3, function() {
- moment.lang('pl');
- equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
- equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
- equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('pl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Dziś o 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Dziś o 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Dziś o 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Jutro o 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Dziś o 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Portuguese
- *************************************************/
-
-module("lang:pt");
-
-test("parse", 96, function() {
- moment.lang('pt');
- var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pt');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domingo Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 de Fevereiro de 2010'],
- ['LLL', '14 de Fevereiro de 2010 15:25'],
- ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pt');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('pt');
- var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pt');
- var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pt');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pt');
- equal(moment(30000).from(0), "em segundos", "prefix");
- equal(moment(0).from(30000), "segundos atrás", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('pt');
- equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
- equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('pt');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pt');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pt');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- 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");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pt');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Russian
- *************************************************/
-
-module("lang:ru");
-
-test("parse", 96, function() {
- moment.lang('ru');
- var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('ru');
- 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', '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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-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++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ru');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('ru');
- var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ru');
- var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ru');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минут", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минут", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "часа", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "часа", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часов", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месяц", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месяц", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месяц", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месяц", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месяцев", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "год", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "год", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "год", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 лет", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ru');
- equal(moment(30000).from(0), "через несколько секунд", "prefix");
- equal(moment(0).from(30000), "несколько секунд назад", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('ru');
- equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
- equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('ru');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Сегодня в 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Сегодня в 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Сегодня в 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Завтра в 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Сегодня в 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- return d.day() === 1 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- switch (d.day()) {
- case 0:
- case 1:
- case 3:
- return '[В прошлый] dddd [в] LT';
- case 6:
- return '[В прошлое] dddd [в] LT';
- default:
- return '[В прошлую] dddd [в] LT';
- }
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ru');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:sv");
-
-test("parse", 96, function() {
- moment.lang('sv');
- var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('sv');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'söndag, februari 14e 2010, 3:25:50 pm'],
- ['ddd, hA', 'sön, 3PM'],
- ['M Mo MM MMMM MMM', '2 2a 02 februari feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14e 14'],
- ['d do dddd ddd', '0 0e söndag sön'],
- ['DDD DDDo DDDD', '45 45e 045'],
- ['w wo ww', '8 8e 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45e day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'söndag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('sv');
- equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
- equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');
- equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e');
- equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e');
- equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e');
- equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e');
- equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e');
- equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e');
- equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e');
- equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e');
- equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e');
- equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e');
- equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e');
- equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e');
- equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e');
- equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e');
- equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e');
- equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e');
- equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');
- equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');
- equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e');
- equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e');
- equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e');
- equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e');
- equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e');
- equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e');
- equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e');
- equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');
-});
-
-test("format month", 12, function() {
- moment.lang('sv');
- var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('sv');
- var expected = 'söndag sön_måndag mån_tisdag tis_onsdag ons_torsdag tor_fredag fre_lördag lör'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('sv');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "några sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "en minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "en minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en timme", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en timme", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timmar", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timmar", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timmar", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagar", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagar", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagar", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en månad", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en månad", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en månad", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 månader", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 månader", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 månader", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en månad", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 månader", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 månader", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('sv');
- equal(moment(30000).from(0), "om några sekunder", "prefix");
- equal(moment(0).from(30000), "för några sekunder sen", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('sv');
- equal(moment().fromNow(), "för några sekunder sen", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('sv');
- equal(moment().add({s:30}).fromNow(), "om några sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('sv');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Idag klockan 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Idag klockan 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Idag klockan 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Imorgon klockan 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Idag klockan 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Igår klockan 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('sv');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('sv');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('sv');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-/**************************************************
- Turkish
- *************************************************/
-
-module("lang:tr");
-
-test("parse", 96, function() {
- moment.lang('tr');
- var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('tr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Pazar, Şubat 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Paz, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 Şubat Şub'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Pazar Paz'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14 Şubat 2010'],
- ['LLL', '14 Şubat 2010 15:25'],
- ['LLLL', 'Pazar, 14 Şubat 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('tr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('tr');
- var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('tr');
- var expected = 'Pazar Paz_Pazartesi Pts_Salı Sal_Çarşamba Çar_Perşembe Per_Cuma Cum_Cumartesi Cts'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('tr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "birkaç saniye", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "bir dakika", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "bir dakika", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 dakika", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 dakika", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "bir saat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "bir saat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 saat", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 saat", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 saat", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "bir gün", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "bir gün", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 gün", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "bir gün", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 gün", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 gün", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "bir ay", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "bir ay", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "bir ay", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 ay", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 ay", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 ay", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "bir ay", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 ay", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 ay", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "bir yıl", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "bir yıl", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 yıl", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "bir yıl", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 yıl", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('tr');
- equal(moment(30000).from(0), "birkaç saniye sonra", "prefix");
- equal(moment(0).from(30000), "birkaç saniye önce", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('tr');
- equal(moment().fromNow(), "birkaç saniye önce", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('tr');
- equal(moment().add({s:30}).fromNow(), "birkaç saniye sonra", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5 gün sonra", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('tr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "bugün saat 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "bugün saat 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "bugün saat 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "yarın saat 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "bugün saat 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "dün 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('tr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('tr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('tr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-})();
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=nocachebuster"><title>Moment.js Unit Test Suite</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="test"><h1>Moment.js unit test suite</h1><h2 id="qunit-banner"></h2><h4 id="qunit-userAgent"></h4><ol id="qunit-tests"></ol></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/moment.js?_=nocachebuster"></script><script src="../js/lang-all.min.js?_=nocachebuster"></script><script src="../js/test.min.js?_=nocachebuster"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
-(function(d, c) {
- var ga = d.createElement(c); ga.async = true;
- ga.src = "http://www.google-analytics.com/ga.js";
- var s = d.getElementsByTagName(c)[0];
- s.parentNode.insertBefore(ga, s);
-})(document, 'script');
-</script></body></html>
\ No newline at end of file
+++ /dev/null
-/**\r
- * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)\r
- * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark\r
- * html5doctor.com/html-5-reset-stylesheet/\r
- */\r
-\r
-html, body, div, span, object, iframe,\r
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,\r
-abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,\r
-small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,\r
-fieldset, form, label, legend,\r
-table, caption, tbody, tfoot, thead, tr, th, td,\r
-article, aside, canvas, details, figcaption, figure,\r
-footer, header, hgroup, menu, nav, section, summary,\r
-time, mark, audio, video {\r
- margin: 0;\r
- padding: 0;\r
- border: 0;\r
- font-size: 100%;\r
- font: inherit;\r
- vertical-align: baseline;\r
-}\r
-\r
-article, aside, details, figcaption, figure,\r
-footer, header, hgroup, menu, nav, section {\r
- display: block;\r
-}\r
-\r
-blockquote, q { quotes: none; }\r
-\r
-blockquote:before, blockquote:after,\r
-q:before, q:after { content: ""; content: none; }\r
-\r
-ins { background-color: #ff9; color: #000; text-decoration: none; }\r
-\r
-mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }\r
-\r
-del { text-decoration: line-through; }\r
-\r
-abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }\r
-\r
-table { border-collapse: collapse; border-spacing: 0; }\r
-\r
-hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }\r
-\r
-input, select { vertical-align: middle; }\r
-\r
-/**\r
- * base styles\r
- */\r
- \r
- \r
-html { background:#eee; text-align:center; color:#333; }\r
-\r
-a { color:#09489A; }\r
-\r
-h1, h2, h3, h4, h5, h6, th { font-family:Oswald, sans-serif; line-height:1.5em; }\r
-\r
-h1 { font-size:36px; padding-top:20px; }\r
-h2 { font-size:24px; padding-top:10px; }\r
-h3 { font-size:18px; padding-top:10px; }\r
-h4 { font-size:16px; }\r
-h5 { font-size:14px; }\r
-h6 { font-size:14px; }\r
-\r
-body, p { font-size:14px; line-height:1.5em; font-family:"Helvetica", "Arial", sans-serif; } \r
-\r
-p { margin-bottom:20px; } \r
-\r
-pre, code { font-size:14px; line-height:1.5em; font-family:Consolas, "Courier New", Courier, monospace; }\r
-\r
-pre { background:#ddd; display:block; border:1px solid #ccc; padding:5px 10px; margin-bottom:20px; white-space:pre; white-space:pre-wrap; word-wrap:break-word; border-radius:2px; }\r
-\r
-p code { background:#ddd; padding:3px; border-radius:2px; }\r
-\r
-table { margin-bottom:20px; width:100%; } \r
-\r
-th { font-size:21px; padding:10px 20px; }\r
-td { border-top:1px solid #313749; padding:5px 20px; }\r
-td + td { background:rgba(255, 255, 255, .2); }\r
-\r
-b, strong { font-weight:bold; }\r
-\r
-\r
-/****************\r
- Special\r
-****************/\r
-\r
-\r
-.footer { height:100px; }\r
-\r
-\r
-/****************\r
- Nav\r
-****************/\r
-\r
-\r
-#navwrap {\r
- background-color: #333;\r
- background-image: -webkit-gradient(linear, left top, left bottom, from(#333), to(#000)); \r
- background-image: -webkit-linear-gradient(top, #333, #000); \r
- background-image: -moz-linear-gradient(top, #333, #000); \r
- background-image: -ms-linear-gradient(top, #333, #000); \r
- background-image: -o-linear-gradient(top, #333, #000); \r
- background-image: linear-gradient(top, #333, #000);\r
- filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#333', EndColorStr='#000');\r
- height:60px;\r
- border-bottom:1px solid #fff;\r
-}\r
-#navwrap h1 { float:left; line-height:60px; padding:0; color:#fff; margin-right:100px; padding-left:37px; background:url(../img/clock.png) 0 15px no-repeat; }\r
-#nav { height:60px; width:960px; margin:0 auto; text-align:left; }\r
-#navwrap ul { padding:10px 0; height:40px; }\r
-#navwrap li { line-height:40px; height:40px; margin-right:10px; float:left; list-style:none; }\r
-#navwrap li a { display:block; font-size:18px; font-family:Oswald, sans-serif; text-decoration:none; }\r
-\r
-\r
-/****************\r
- Home\r
-****************/\r
-\r
-\r
-#home { margin:50px auto 200px; overflow:hidden; width:960px; }\r
-#home h2 { background:url(../img/clock-large.png) 160px 0 no-repeat; line-height:201px; font-size:100px; text-align:left; padding-left:380px; text-shadow:-1px -1px 0 #fff; }\r
-#home h3 { margin-bottom:50px; }\r
-#home .col1 { width:280px; margin:0 20px; float:left; }\r
-#home .col2 { width:600px; margin:0 20px; float:left; text-align:left; }\r
-#home h4 { height:14px; border-bottom:6px solid #ddd; margin:0 0 40px; text-align:center; }\r
-#home h4 span { background:#eee; padding:0 10px; line-height:30px; font-size:30px; }\r
-#home h5 { height:8px; border-bottom:6px solid #ddd; margin:0 0 40px; text-align:center; }\r
-#home h5 span { background:#eee; padding:0 10px; line-height:18px; font-size:18px; }\r
-\r
-\r
-/****************\r
- Buttons\r
-****************/\r
-\r
-\r
-.btn { display:block; margin-bottom:20px; text-decoration:none; }\r
-.btn strong { display:block; font-size:20px; line-height:30px; font-family:Oswald, sans-serif; padding:0 10px; }\r
-.btn .version { display:block; font-size:16px; }\r
-.btn .filesize { display:block; font-size:16px; }\r
-\r
-\r
-/****************\r
- Docs Nav\r
-****************/\r
-\r
-\r
-#docnav { width:220px; padding:10px 10px 100px; position:fixed; top:60px; bottom:0; left:0; overflow-x:hidden; overflow-y:scroll; -webkit-overflow-scrolling:touch; text-align:left; }\r
-#docnav h2 { height:18px; border-bottom:6px solid #ddd; margin:0 0 20px; text-align:center; }\r
-#docnav h2 span { background:#eee; padding:0 10px; line-height:18px; font-size:18px; }\r
-#docnav h2 a { text-decoration:none; color:#333; }\r
-#docnav li a { color:#445; display:block; padding:2px 10px; border-radius:4px; cursor:pointer; }\r
-#docnav li a:hover { background:rgba(0, 0, 0, .1); }\r
-#docnav li { list-style:none; font-size:12px; }\r
-\r
-\r
-/****************\r
- Scrollbar\r
-****************/\r
-\r
-\r
-#docs::-webkit-scrollbar,\r
-#docnav::-webkit-scrollbar { height:8px; width:8px; }\r
-#docs::-webkit-scrollbar-track-piece,\r
-#docnav::-webkit-scrollbar-track-piece { margin:10px; border-radius:4px; }\r
-#docs::-webkit-scrollbar-thumb:vertical,\r
-#docnav::-webkit-scrollbar-thumb:vertical{ height:25px; background-color:#bbb; -webkit-border-radius:4px; }\r
-#docs:hover::-webkit-scrollbar-thumb:vertical,\r
-#docnav:hover::-webkit-scrollbar-thumb:vertical{ background-color:#666; }\r
-\r
-\r
-/****************\r
- Docs\r
-****************/\r
-\r
-\r
-#docs { padding:0 100px 0 40px; position:fixed; top:60px; bottom:0; right:10px; left:242px; overflow-x:hidden; overflow-y:scroll; text-align:left; background:url(../img/gradient.gif) 0 0 repeat-y; -webkit-overflow-scrolling:touch; }\r
-#docs h2 { height:20px; border-bottom:6px solid #bbb; margin:0 0 40px; padding:20px 20px 0; }\r
-#docs h2 span { background:#eee; padding:0 10px; line-height:36px; font-size:36px; }\r
-#docs h3 { height:14px; border-bottom:6px solid #e6e6e6; margin:0 0 40px; padding:20px 20px 0; }\r
-#docs h3 span { background:#eee; padding:0 10px; line-height:24px; font-size:24px; }\r
-#docs h4 { margin-bottom:10px; }\r
-\r
-\r
-/****************\r
- Test\r
-****************/\r
-\r
-\r
-#test { margin:0 auto; width:960px; text-align:left; }\r
-\r
-\r
-/**********************\r
- Typical Styles\r
-**********************/\r
-\r
-\r
-.sh_typical{background:none; padding:0; margin:0; border:0 none;}\r
-.sh_typical .sh_sourceCode{color:#586e75;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_keyword{color:#2aa198;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_type{color:#00f;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_string{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_regexp{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_specialchar{color:#C42DA8;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_comment{color:#93a1a1;font-weight:normal;font-style:italic;}\r
-.sh_typical .sh_sourceCode .sh_number{color:#dc322f;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_preproc{color:#00b800;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_symbol{color:#586e75;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_function{color:#586e75;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_cbracket{color:#586e75;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_url{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_date{color:#00f;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_time{color:#00f;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_file{color:#00f;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_ip{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_name{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_variable{color:#268bd2;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_oldfile{color:#C42DA8;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_newfile{color:#f00;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_difflines{color:#00f;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_selector{color:#ec7f15;font-weight:normal;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_property{color:#268bd2;font-weight:bold;font-style:normal;}\r
-.sh_typical .sh_sourceCode .sh_value{color:#f00;font-weight:normal;font-style:normal;}\r
-\r
-\r
-/*******************\r
- Base Styles\r
-*******************/\r
-\r
-\r
-.snippet-wrap {position:relative;}\r
-*:first-child+html .snippet-wrap {display:inline-block;}\r
-* html .snippet-wrap {display:inline-block;}\r
-.snippet-reveal{text-decoration:underline;}\r
-.snippet-wrap .snippet-menu, .snippet-wrap .snippet-hide {position:absolute; top:10px; right:15px; font-size:.9em;z-index:1;background-color:transparent;}\r
-.snippet-wrap .snippet-hide {top:auto; bottom:10px;}\r
-*:first-child+html .snippet-wrap .snippet-hide {bottom:25px;}\r
-* html .snippet-wrap .snippet-hide {bottom:25px;}\r
-.snippet-wrap .snippet-menu pre, .snippet-wrap .snippet-hide pre {background-color:transparent; margin:0; padding:0;}\r
-.snippet-wrap .snippet-menu a, .snippet-wrap .snippet-hide a {padding:0 5px; text-decoration:underline;}\r
-.snippet-wrap pre.sh_sourceCode{line-height:1.8em;overflow:auto;position:relative;}\r
-* html .snippet-wrap pre.snippet-formatted {padding:2em 1em;}\r
-.snippet-reveal pre.sh_sourceCode {text-align:right;}\r
-.snippet-wrap .snippet-num li{padding-left:1.5em;}\r
-.snippet-wrap .snippet-no-num{list-style:none;margin:0;}\r
-.snippet-wrap .snippet-no-num li {list-style:none; min-height:25px;}\r
-.snippet-wrap .snippet-num {margin:1em 0 1em 1em; padding-left:3em;}\r
-.snippet-wrap .snippet-num li {list-style:decimal-leading-zero outside none;}\r
-.snippet-wrap .snippet-no-num li.box {padding:0 6px; margin-left:-6px;}\r
-.snippet-wrap .snippet-num li.box {border:1px solid; list-style-position:inside; margin-left:-3em; padding-left:6px;}\r
-*:first-child+html .snippet-wrap .snippet-num li.box {margin-left:-2.4em;}\r
-* html .snippet-wrap .snippet-num li.box {margin-left:-2.4em;}\r
-.snippet-wrap li.box-top {border-width:1px 1px 0 !important;}\r
-.snippet-wrap li.box-bot {border-width:0 1px 1px !important;}\r
-.snippet-wrap li.box-mid {border-width:0 1px !important;}\r
-.snippet-wrap .snippet-num li .box-sp {width:18px; display:inline-block;}\r
-*:first-child+html .snippet-wrap .snippet-num li .box-sp {width:27px;}\r
-* html .snippet-wrap .snippet-num li .box-sp {width:27px;}\r
-.snippet-wrap .snippet-no-num li.box {border:1px solid;}\r
-.snippet-wrap .snippet-no-num li .box-sp {display:none;}\r
-\r
-\r
-/****************\r
- Buttons\r
-****************/\r
-\r
-\r
-.btn.minimal {\r
- background: #e3e3e3;\r
- border: 1px solid #bbb;\r
- -webkit-border-radius: 3px;\r
- -moz-border-radius: 3px;\r
- -ms-border-radius: 3px;\r
- -o-border-radius: 3px;\r
- border-radius: 3px;\r
- -webkit-box-shadow: inset 0 0 1px 1px #f6f6f6;\r
- -moz-box-shadow: inset 0 0 1px 1px #f6f6f6;\r
- -ms-box-shadow: inset 0 0 1px 1px #f6f6f6;\r
- -o-box-shadow: inset 0 0 1px 1px #f6f6f6;\r
- box-shadow: inset 0 0 1px 1px #f6f6f6;\r
- color: #333;\r
- line-height: 1;\r
- padding: 8px 0 9px;\r
- text-align: center;\r
- text-shadow: 0 1px 0 #fff;\r
-}\r
-.btn.minimal:hover {\r
- background: #d9d9d9;\r
- -webkit-box-shadow: inset 0 0 1px 1px #eaeaea;\r
- -moz-box-shadow: inset 0 0 1px 1px #eaeaea;\r
- -ms-box-shadow: inset 0 0 1px 1px #eaeaea;\r
- -o-box-shadow: inset 0 0 1px 1px #eaeaea;\r
- box-shadow: inset 0 0 1px 1px #eaeaea;\r
- color: #222;\r
- cursor: pointer;\r
-}\r
-.btn.minimal:active {\r
- background: #d0d0d0;\r
- -webkit-box-shadow: inset 0 0 1px 1px #e3e3e3;\r
- -moz-box-shadow: inset 0 0 1px 1px #e3e3e3;\r
- -ms-box-shadow: inset 0 0 1px 1px #e3e3e3;\r
- -o-box-shadow: inset 0 0 1px 1px #e3e3e3;\r
- box-shadow: inset 0 0 1px 1px #e3e3e3;\r
- color: #000;\r
-}\r
-.btn.cupid-green {\r
- background-color: #7fbf4d;\r
- background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#63a62f));\r
- background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);\r
- background-image: -moz-linear-gradient(top, #7fbf4d, #63a62f);\r
- background-image: -ms-linear-gradient(top, #7fbf4d, #63a62f);\r
- background-image: -o-linear-gradient(top, #7fbf4d, #63a62f);\r
- background-image: linear-gradient(top, #7fbf4d, #63a62f);\r
- border: 1px solid #63a62f;\r
- border-bottom: 1px solid #5b992b;\r
- -webkit-border-radius: 3px;\r
- -moz-border-radius: 3px;\r
- -ms-border-radius: 3px;\r
- -o-border-radius: 3px;\r
- border-radius: 3px;\r
- -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;\r
- -moz-box-shadow: inset 0 1px 0 0 #96ca6d;\r
- -ms-box-shadow: inset 0 1px 0 0 #96ca6d;\r
- -o-box-shadow: inset 0 1px 0 0 #96ca6d;\r
- box-shadow: inset 0 1px 0 0 #96ca6d;\r
- color: #fff;\r
- line-height: 1;\r
- padding: 7px 0 8px 0;\r
- text-align: center;\r
- text-shadow: 0 -1px 0 #4c9021;\r
-}\r
-.btn.cupid-green:hover {\r
- background-color: #76b347;\r
- background-image: -webkit-gradient(linear, left top, left bottom, from(#76b347), to(#5e9e2e));\r
- background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);\r
- background-image: -moz-linear-gradient(top, #76b347, #5e9e2e);\r
- background-image: -ms-linear-gradient(top, #76b347, #5e9e2e);\r
- background-image: -o-linear-gradient(top, #76b347, #5e9e2e);\r
- background-image: linear-gradient(top, #76b347, #5e9e2e);\r
- -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;\r
- -moz-box-shadow: inset 0 1px 0 0 #8dbf67;\r
- -ms-box-shadow: inset 0 1px 0 0 #8dbf67;\r
- -o-box-shadow: inset 0 1px 0 0 #8dbf67;\r
- box-shadow: inset 0 1px 0 0 #8dbf67;\r
- cursor: pointer; \r
-}\r
-.btn.cupid-green:active {\r
- border: 1px solid #5b992b;\r
- border-bottom: 1px solid #538c27;\r
- -webkit-box-shadow: inset 0 0 8px 4px #548c29, 0 1px 0 0 #eeeeee;\r
- -moz-box-shadow: inset 0 0 8px 4px #548c29, 0 1px 0 0 #eeeeee;\r
- -ms-box-shadow: inset 0 0 8px 4px #548c29, 0 1px 0 0 #eeeeee;\r
- -o-box-shadow: inset 0 0 8px 4px #548c29, 0 1px 0 0 #eeeeee;\r
- box-shadow: inset 0 0 8px 4px #548c29, 0 1px 0 0 #eeeeee; \r
-}\r
-.btn.clean-gray {\r
- background-color: #eeeeee;\r
- background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#cccccc));\r
- background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);\r
- background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);\r
- background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);\r
- background-image: -o-linear-gradient(top, #eeeeee, #cccccc);\r
- background-image: linear-gradient(top, #eeeeee, #cccccc);\r
- border: 1px solid #ccc;\r
- border-bottom: 1px solid #bbb;\r
- -webkit-border-radius: 3px;\r
- -moz-border-radius: 3px;\r
- -ms-border-radius: 3px;\r
- -o-border-radius: 3px;\r
- border-radius: 3px;\r
- color: #333;\r
- line-height: 1;\r
- padding: 8px 10px;\r
- text-align: center;\r
- text-shadow: 0 1px 0 #eee;\r
-}\r
-.btn.clean-gray:hover {\r
- background-color: #dddddd;\r
- background-image: -webkit-gradient(linear, left top, left bottom, from(#dddddd), to(#bbbbbb));\r
- background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);\r
- background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);\r
- background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);\r
- background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);\r
- background-image: linear-gradient(top, #dddddd, #bbbbbb);\r
- border: 1px solid #bbb;\r
- border-bottom: 1px solid #999;\r
- cursor: pointer;\r
- text-shadow: 0 1px 0 #ddd;\r
-}\r
-.btn.clean-gray:active {\r
- border: 1px solid #aaa;\r
- border-bottom: 1px solid #888;\r
- -webkit-box-shadow: inset 0 0 5px 2px #aaaaaa;\r
- -moz-box-shadow: inset 0 0 5px 2px #aaaaaa;\r
- -ms-box-shadow: inset 0 0 5px 2px #aaaaaa;\r
- -o-box-shadow: inset 0 0 5px 2px #aaaaaa;\r
- box-shadow: inset 0 0 5px 2px #aaaaaa;\r
-}\r
-\r
-\r
-/****************\r
- Q Unit\r
-****************/\r
-\r
-\r
-#qunit-banner { height:20px; }\r
-#qunit-testrunner-toolbar { padding: 0.5em 0 0.5em 2em; color: #5E740B; background-color: #eee;}\r
-\r
-\r
-/****************\r
- Q Unit Pass/Fail\r
-****************/\r
-\r
-#qunit-tests { list-style-position:inside; padding-bottom:20px; border-bottom:#313749 10px solid; margin-bottom:20px; }\r
-#qunit-tests li { padding:5px 10px; list-style-position:inside; }\r
-#qunit-tests th, \r
-#qunit-tests pre { font-size:14px; }\r
-#qunit-tests.hidepass li.pass { display:none; }\r
-#qunit-tests li strong { cursor:pointer; }\r
-#qunit-tests ol { margin-top:0.5em; padding:0.5em; background-color:#fff; }\r
-#qunit-tests table { border-collapse:collapse; margin-top:.2em; }\r
-\r
-#qunit-tests th {\r
- text-align: right;\r
- vertical-align: top;\r
- padding: 0 .5em 0 0;\r
-}\r
-\r
-#qunit-tests td {\r
- vertical-align: top;\r
-}\r
-\r
-#qunit-tests pre {\r
- margin: 0;\r
- white-space: pre-wrap;\r
- word-wrap: break-word;\r
-}\r
-\r
-#qunit-tests del {\r
- background-color: #e0f2be;\r
- color: #374e0c;\r
- text-decoration: none;\r
-}\r
-\r
-#qunit-tests ins {\r
- background-color: #ffcaca;\r
- color: #500;\r
- text-decoration: none;\r
-}\r
-\r
-\r
-#qunit-tests b.counts { color: black; }\r
-#qunit-tests b.passed { color: #5E740B; }\r
-#qunit-tests b.failed { color: #710909; }\r
-\r
-#qunit-tests li li {\r
- margin: 0.5em;\r
- padding: 0.4em 0.5em 0.4em 0.5em;\r
- background-color: #fff;\r
- border-bottom: none;\r
- list-style-position: inside;\r
-}\r
-\r
-/*** Passing Styles */\r
-\r
-#qunit-tests li li.pass {\r
- color: #5E740B;\r
- background-color: #fff;\r
- border-left: 26px solid #C6E746;\r
-}\r
-\r
-#qunit-tests .pass .test-name { color:#666; }\r
-#qunit-tests .pass .test-actual,\r
-#qunit-tests .pass .test-expected { color:#999; }\r
-#qunit-tests .pass b.failed { color:#ccc; }\r
-\r
-/*** Failing Styles */\r
-\r
-#qunit-tests li li.fail {\r
- color: #710909;\r
- background-color: #fff;\r
- border-left: 26px solid #EE5757;\r
-}\r
-\r
-#qunit-tests .fail { color: #000000; background-color: #EE5757; }\r
-#qunit-tests .fail .test-name,\r
-#qunit-tests .fail .module-name { color: #000000; }\r
-\r
-#qunit-tests .fail .test-actual { color: #EE5757; }\r
-#qunit-tests .fail .test-expected { color: green; }\r
-\r
-#qunit-banner.qunit-fail { background-color: #EE5757; }\r
-\r
-\r
-/** Result */\r
-\r
-.test-expected th { width:100px; }\r
-\r
-\r
-/** Fixture */\r
-\r
-#qunit-fixture {\r
- position: absolute;\r
- top: -10000px;\r
- left: -10000px;\r
-}
\ No newline at end of file
+++ /dev/null
-extends html
-
-block styles
- link(rel="stylesheet", href="../css/style.css?_=" + builddate)
- title Moment.js Documentation
-
-block scripts
- script(src="../js/docs.min.js?_=" + builddate)
-
-block content
- #docnav
- h2
- a(href="#/get-it")
- span Get it
- ul
- li
- a(href="#/get-it/github") Github
- li
- a(href="#/get-it/npm") npm
- h2
- a(href="#/use-it")
- span Use it
- ul
- li
- a(href="#/use-it/node") In NodeJS
- li
- a(href="#/use-it/browser") In the browser
- h2
- a(href="#/parsing")
- span Parsing
- ul
- li
- a(href="#/parsing/date") Javascript Date Object
- li
- a(href="#/parsing/unix") Unix Timestamp
- li
- a(href="#/parsing/string") String
- li
- a(href="#/parsing/string+format") String + Format
- li
- a(href="#/parsing/string+formats") String + Formats
- li
- a(href="#/parsing/now") Now
- li
- a(href="#/parsing/array") Javascript Array
- li
- a(href="#/parsing/asp-net") ASP.NET json dates
- li
- a(href="#/parsing/clone") Cloning
- h2
- a(href="#/manipulation")
- span Manipulation
- ul
- li
- a(href="#/manipulation/add") Add
- li
- a(href="#/manipulation/subtract") Subtract
- li
- a(href="#/manipulation/milliseconds") Milliseconds
- li
- a(href="#/manipulation/seconds") Seconds
- li
- a(href="#/manipulation/minutes") Minutes
- li
- a(href="#/manipulation/hours") Hours
- li
- a(href="#/manipulation/date") Date
- li
- a(href="#/manipulation/day") Day
- li
- a(href="#/manipulation/month") Month
- li
- a(href="#/manipulation/year") Year
- li
- a(href="#/manipulation/sod") Start of Day
- li
- a(href="#/manipulation/eod") End of Day
- h2
- a(href="#/display")
- span Display
- ul
- li
- a(href="#/display/format") Formatted date
- li
- a(href="#/display/from") Time from another moment
- li
- a(href="#/display/fromNow") Time from now
- li
- a(href="#/display/calendar") Calendar time
- li
- a(href="#/display/diff") Difference
- li
- a(href="#/display/toDate") Native Javascript Date
- li
- a(href="#/display/valueOf") Value
- li
- a(href="#/display/milliseconds") Milliseconds
- li
- a(href="#/display/seconds") Seconds
- li
- a(href="#/display/minutes") Minutes
- li
- a(href="#/display/hours") Hours
- li
- a(href="#/display/date") Date
- li
- a(href="#/display/day") Day
- li
- a(href="#/display/month") Month
- li
- a(href="#/display/year") Year
- li
- a(href="#/display/leapyear") Leap Year
- li
- a(href="#/display/zone") Timezone Offset
- li
- a(href="#/display/dst") Daylight Savings Time
- h2
- a(href="#/i18n")
- span I18N
- ul
- li
- a(href="#/i18n/lang") Changing languages
- li
- a(href="#/i18n/node") Loading languages in NodeJS
- li
- a(href="#/i18n/browser") Loading languages in the browser
- li
- a(href="#/i18n/add") Adding your language to Moment.js
- h2
- a(href="#/custom")
- span Customization
- ul
- li
- a(href="#/custom/months") Month Names
- li
- a(href="#/custom/monthsShort") Month Abbreviations
- li
- a(href="#/custom/weekdays") Weekday Names
- li
- a(href="#/custom/weekdaysShort") Weekday Abbreviations
- li
- a(href="#/custom/longDateFormats") Long Date Formats
- li
- a(href="#/custom/relativeTime") Relative Time
- li
- a(href="#/custom/meridiem") AM/PM
- li
- a(href="#/custom/calendar") Calendar
- li
- a(href="#/custom/ordinal") Ordinal
- h2
- a(href="#/plugins")
- span Plugins
- ul
- li
- a(href="#/plugins/strftime") strftime
- #docs
- h1 Moment.js Documentation
- p A lightweight javascript date library for parsing, manipulating, and formatting dates.
-
-
- a(name="/get-it")
- h2
- span Where to get it
-
-
- a(name="/get-it/github")
- h3
- span Github
- a.btn.cupid-green(href="https://raw.github.com/timrwood/moment/" + version + "/moment.min.js")
- strong Production
- span.version= 'Version ' + version
- span.filesize= minsize + ' minified & gzipped'
- a.btn.minimal(href="https://raw.github.com/timrwood/moment/" + version + "/moment.js")
- strong Development
- span.version= 'Version ' + version
- span.filesize= srcsize + ' full source + comments'
- p You can also clone the project with Git by running:
- pre git clone git://github.com/timrwood/moment
-
-
- a(name="/get-it/npm")
- h3
- span npm
- pre npm install moment
-
-
- a(name="/use-it")
- h2
- span Where to use it
- p Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.
-
-
- a(name="/use-it/node")
- h3
- span In NodeJS
- pre var moment = require('moment');\n
- | moment().add('hours', 1).fromNow(); // "1 hour ago"
-
-
- a(name="/use-it/browser")
- h3
- span In the browser
- pre <script src="moment.min.js"></script>\n
- | moment().add('hours', 1).fromNow(); // "1 hour ago"
-
-
- a(name="/parsing")
- h2
- span Parsing
- p Instead of modifying the native
- code Date.prototype
- | , Moment.js creates a wrapper for the
- code Date
- | object.
- p Note: The Moment.js prototype is exposed through
- code moment.fn
- | . If you want to add your own functions, that is where you would put them.
- p To get this wrapper object, simply call
- code moment()
- | with one of the supported input types.
-
-
- a(name="/parsing/date")
- h3
- span Javascript Date Object
- p A native Javascript Date object.
- pre var day = new Date(2011, 9, 16);\n
- | var dayWrapper = moment(day);
- pre var otherDay = moment(new Date(2020, 3, 7));
- p This is the fastest way to get a Moment.js wrapper.
-
-
- a(name="/parsing/unix")
- h3
- span Unix Timestamp
- p An integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC.
- pre var day = moment(1318781876406);
-
-
- a(name="/parsing/string")
- h3
- span String
- p A string that can be parsed by
- code Date.parse
- | .
- pre var day = moment("Dec 25, 1995");
- p Browser support for this is somewhat inconsistent. If you are not getting consistent results, you can try using String + Format.
-
-
- a(name="/parsing/string+format")
- h3
- span String + Format
- p An input string and a format string
- pre var day = moment("12-25-1995", "MM-DD-YYYY");
- p The format parsing tokens are similar to the tokens for
- code moment.fn.format
- | .
- p The parser ignores non-alphanumeric characters, so both
- code moment("12-25-1995", "MM-DD-YYYY")
- | and
- code moment("12\\25\\1995", "MM-DD-YYYY")
- | will return the same thing.
- table
- tbody
- tr
- th Input
- th Output
- tr
- td M or MM
- td Month Number (1 - 12)
- tr
- td MMM or MMMM
- td Month Name (In currently language set by
- code moment.lang()
- | )
- tr
- td D or DD
- td Day of month
- tr
- td DDD or DDDD
- td Day of year
- tr
- td d, dd, ddd, or dddd
- td Day of week (NOTE: these tokens are not used to create the date, as there are 4-5 weeks in a month, and it would be impossible to get the date based off the day of the week)
- tr
- td YY
- td 2 digit year (if greater than 70, will return 1900's, else 2000's)
- tr
- td YYYY
- td 4 digit year
- tr
- td a or A
- td AM/PM
- tr
- td H, HH
- td 24 hour time
- tr
- td h, or hh
- td 12 hour time (use in conjunction with a or A)
- tr
- td m or mm
- td Minutes
- tr
- td s or ss
- td Seconds
- tr
- td Z or ZZ
- td Timezone offset as
- code +0700
- | or
- code +07:30
- p Unless you specify a timezone offset, parsing a string will create a date in the current timezone.
- p A workaround to parse a string in UTC is to append
- code "+0000"
- | to the end of your input string, and add
- code "ZZ"
- | to the end of your format string.
- p
- strong Important:
- | Parsing a string with a format is by far the slowest method of creating a date.
- | If you have the ability to change the input, it is much faster (~15x) to use Unix timestamps.
-
-
- a(name="/parsing/string+formats")
- h3
- span String + Formats
- p An input string and an array of format strings.
- p This is the same as String + Format, only it will try to match the input to multiple formats.
- pre var day = moment("12-25-1995", ["MM-DD-YYYY", "YYYY-MM-DD"]);
- p This approach is fundamentally problematic in cases like the following, where there is a difference in big, medium, or little endian date formats.
- pre var day = moment("05-06-1995", ["MM-DD-YYYY", "DD-MM-YYYY"]); // June 5th or May 6th?
- p
- strong Important:
- | THIS IS SLOW. This should only be used as a last line of defense.
-
-
- a(name="/parsing/now")
- h3
- span Now
- p To get the current date and time, just call
- code moment()
- | with no parameters.
- pre var now = moment();
- p This is essentially the same as calling
- code moment(new Date())
- | .
-
-
- a(name="/parsing/array")
- h3
- span Javascript Array
- p An array mirroring the parameters passed into
- a(href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date") new Date()
- pre [year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0] \n
- | var day = moment([2010, 1, 14, 15, 25, 50, 125]); // February 14th, 3:25:50.125 PM
- p Any value past the year is optional, and will default to the lowest possible number.
- pre var day = moment([2010]); // January 1st \n
- | var day = moment([2010, 6]); // July 1st
- | var day = moment([2010, 6, 10]); // July 10th
- p Construction with an array will create a date in the current timezone. To create a date from an array at UTC, you can use the following.
- pre var array = [2010, 1, 14, 15, 25, 50, 125];\n
- | var day = moment(Date.UTC.apply({}, array));
-
-
- a(name="/parsing/asp-net")
- h3
- span ASP.NET style json dates
- p ASP.NET returns dates in json in the following formats.
- code /Date(1198908717056)/
- | or
- code /Date(1198908717056-0700)/
- p If a string that matches this format is passed in, it will be parsed correctly.
- pre moment("/Date(1198908717056-0700)/").valueOf(); // 1198908717056
-
-
- a(name="/parsing/clone")
- h3
- span Cloning
- p All moments are mutable. If you want a clone of a moment, you can do so explicitly or implicitly.
- p Calling
- code moment()
- | on a moment will clone it.
- pre var a = moment([2012]);\n
- | var b = moment(a);
- | a.year(2000);
- | b.year(); // 2012
- p Additionally, you can call
- code moment.fn.clone
- | to clone a moment.
- pre var a = moment([2012]);\n
- | var b = a.clone();
- | a.year(2000);
- | b.year(); // 2012
-
-
- a(name="/manipulation")
- h2
- span Manipulation
- p Once you have a Moment.js wrapper object, you may want to manipulate it in some way. There are a number of
- code moment.fn
- | methods to help with this.
- p All manipulation methods are chainable, so you can do crazy things like this.
- pre moment().add('days', 7).subtract('months', 1).year(2009).hours(0).minutes(0).seconds(0);
- p It should be noted that moments are mutable. Calling any of the manipulation methods will change the original moment.
- p If you want to create a copy and manipulate it, you should use
- code moment.fn.clone
- | before manipulating the moment.
- a(href="#/parsing/clone") More info on cloning.
-
-
- a(name="/manipulation/add")
- h3
- span Adding Time
- p This is a pretty robust function for adding time to an existing date.
- | To add time, pass the key of what time you want to add, and the amount you want to add.
- pre moment().add('days', 7);
- p There are some shorthand keys as well if you're into that whole brevity thing.
- pre moment().add('d', 7);
- table
- tbody
- tr
- th Key
- th Shorthand
- tr
- td years
- td y
- tr
- td months
- td M
- tr
- td weeks
- td w
- tr
- td days
- td d
- tr
- td hours
- td h
- tr
- td minutes
- td m
- tr
- td seconds
- td s
- tr
- td milliseconds
- td ms
- p If you want to add multiple different keys at the same time, you can pass them in as an object literal.
- pre moment().add('days', 7).add('months', 1); // with chaining \n
- | moment().add({days:7,months:1}); // with object literal
- p There are no upper limits for the amounts, so you can overload any of the parameters.
- pre moment().add('milliseconds', 1000000); // a million milliseconds \n
- | moment().add('days', 360); // 360 days
- h4 Special considerations for months and years
- p If the day of the month on the original date is greater than the number of days in the final month,
- | the day of the month will change to the last day in the final month.
- p Example:
- pre moment([2010, 0, 31]); // January 31 \n
- | moment([2010, 0, 31]).add('months', 1); // February 28
- p There are also special considerations to keep in mind when adding time that crosses over Daylight Savings Time.
- | If you are adding years, months, weeks, or days, the original hour will always match the added hour.
- pre var m = moment(new Date(2011, 2, 12, 5, 0, 0)); // the day before DST in the US\n
- | m.hours(); // 5
- | m.add('days', 1).hours(); // 5
- p If you are adding hours, minutes, seconds, or milliseconds, the assumption is that you want precision to the hour, and will result in a different hour.
- pre var m = moment(new Date(2011, 2, 12, 5, 0, 0)); // the day before DST in the US\n
- | m.hours(); // 5
- | m.add('hours', 24).hours(); // 6
-
-
- a(name="/manipulation/subtract")
- h3
- span Subtracting Time
- p This is exactly the same as
- code moment.fn.add
- | , only instead of adding time, it subtracts time.
- pre moment().subtract('days', 7);
-
-
- a(name="/manipulation/milliseconds")
- h3
- span Milliseconds
- p There are a number of shortcut getter and setter functions.
- | Much like in jQuery, calling the function without paremeters causes it to function as a getter,
- | and calling with a parameter causes it to function as a setter.
- p These map to the corresponding function on the native
- code Date
- | object.
- pre moment().milliseconds(30) === new Date().setMilliseconds(30);\n
- | moment().milliseconds() === new Date().getMilliseconds();
- p Accepts numbers from 0 to 999
-
-
- a(name="/manipulation/seconds")
- h3
- span Seconds
- p Accepts numbers from 0 to 59
- pre moment().seconds(30); // set the seconds to 30
-
-
- a(name="/manipulation/minutes")
- h3
- span Minutes
- p Accepts numbers from 0 to 59
- pre moment().minutes(30); // set the minutes to 30
-
-
- a(name="/manipulation/hours")
- h3
- span Hours
- p Accepts numbers from 0 to 23
- pre moment().hours(12); // set the hours to 12
-
-
- a(name="/manipulation/date")
- h3
- span Date
- p Accepts numbers from 1 to 31
- pre moment().date(5); // set the date to 5
- p NOTE:
- code moment.fn.date
- | is used to set the date of the month, and
- code moment.fn.day
- | is used to set the day of the week.
-
-
- a(name="/manipulation/day")
- h3
- span Day
- pre moment().day(5); // set the day of the week to Friday
- p This method can be used to set the day of the week, Sunday being 0 and Saturday being 6.
- p
- code moment.fn.day
- | can also be overloaded to set to a weekday of the previous week, next week, or a week any distance from the moment.
- pre moment().day(-7); // set to last Sunday (0 - 7) \n
- | moment().day(7); // set to next Sunday (0 + 7)
- | moment().day(10); // set to next Wednesday (3 + 7)
- | moment().day(24); // set to 3 Wednesdays from now (3 + 7 + 7 + 7)
-
-
- a(name="/manipulation/month")
- h3
- span Month
- p Accepts numbers from 0 to 11
- pre moment().month(5); // set the month to June
-
-
- a(name="/manipulation/year")
- h3
- span Year
- pre moment().year(1984); // set the year to 1984
-
- a(name="/manipulation/sod")
- h3
- span Start of Day
- pre moment().sod(); // set the time to last midnight
- p This is essentially the same as the following.
- pre moment().hours(0).minutes(0).seconds(0).milliseconds(0);
-
-
- a(name="/manipulation/eod")
- h3
- span End of Day
- pre moment().eod(); // set the time to 11:59:59.999 pm tonight
- p This is essentially the same as the following.
- pre moment().hours(23).minutes(59).seconds(59).milliseconds(999);
-
-
- a(name="/display")
- h2
- span Display
- p Once parsing and manipulation are done, you need some way to display the moment. Moment.js offers many ways of doing that.
-
-
- a(name="/display/format")
- h3
- span Formatted Date
- p The most robust display option is
- code moment.fn.format
- | . It takes a string of tokens and replaces them with their corresponding values from the Date object.
- pre var date = new Date(2010, 1, 14, 15, 25, 50, 125);\n
- | moment(date).format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
- | moment(date).format("ddd, hA"); // "Sun, 3PM"
- table
- tbody
- tr
- th Token
- th Output
- tr
- td
- b Month
- td
- tr
- td M
- td 1 2 ... 11 12
- tr
- td Mo
- td 1st 2nd ... 11th 12th
- tr
- td MM
- td 01 02 ... 11 12
- tr
- td MMM
- td Jan Feb ... Nov Dec
- tr
- td MMMM
- td January February ... November December
- tr
- td
- b Day of Month
- td
- tr
- td D
- td 1 2 ... 30 30
- tr
- td Do
- td 1st 2nd ... 30th 31st
- tr
- td DD
- td 01 02 ... 30 31
- tr
- td
- b Day of Year
- td
- tr
- td DDD
- td 1 2 ... 364 365
- tr
- td DDDo
- td 1st 2nd ... 364th 365th
- tr
- td DDDD
- td 001 002 ... 364 365
- tr
- td
- b Day of Week
- td
- tr
- td d
- td 0 1 ... 5 6
- tr
- td do
- td 0th 1st ... 5th 6th
- tr
- td ddd
- td Sun Mon ... Fri Sat
- tr
- td dddd
- td Sunday Monday ... Friday Saturday
- tr
- td
- b Week of Year
- td
- tr
- td w
- td 1 2 ... 52 53
- tr
- td wo
- td 1st 2nd ... 52nd 53rd
- tr
- td ww
- td 01 02 ... 52 53
- tr
- td
- b Year
- td
- tr
- td YY
- td 70 71 ... 29 30
- tr
- td YYYY
- td 1970 1971 ... 2029 2030
- tr
- td
- b AM/PM
- td
- tr
- td A
- td AM PM
- tr
- td a
- td am pm
- tr
- td
- b Hour
- td
- tr
- td H
- td 0 1 ... 22 23
- tr
- td HH
- td 00 01 ... 22 23
- tr
- td h
- td 1 2 ... 11 12
- tr
- td hh
- td 01 02 ... 11 12
- tr
- td
- b Minute
- td
- tr
- td m
- td 0 1 ... 58 59
- tr
- td mm
- td 00 01 ... 58 59
- tr
- td
- b Second
- td
- tr
- td s
- td 0 1 ... 58 59
- tr
- td ss
- td 00 01 ... 58 59
- tr
- td
- b Timezone
- td
- tr
- td z or zz (lowercase)
- td EST CST ... MST PST
- tr
- td Z
- td -07:00 -06:00 ... +06:00 +07:00
- tr
- td ZZ
- td -0700 -0600 ... +0600 +0700
- tr
- td
- b Localized date format
- td
- tr
- td LT
- td 8:30 PM
- tr
- td L
- td 07/10/1986
- tr
- td LL
- td July 10 1986
- tr
- td LLL
- td July 10 1986 8:30 PM
- tr
- td LLLL
- td Saturday, July 10 1986 8:30 PM
- p To escape characters in format strings, you can use a backslash before any character. NOTE: if you are using a string literal, you will need to escape the backslash, hence the double backslash below.
- pre moment().format('\\\\L'); // outputs 'L'
- p To escape multiple characters, you can wrap the characters in square brackets.
- pre moment().format('[today] DDDD'); // 'today Sunday'
- p While these date formats are very similar to LDML date formats, there are a few minor differences regarding day of month, day of year, and day of week.
- p For a breakdown of a few different date formatting tokens, see
- a(href="https://docs.google.com/spreadsheet/ccc?key=0AtgZluze7WMJdDBOLUZfSFIzenIwOHNjaWZoeGFqbWc&hl=en_US#gid=0") this chart of date formatting tokens.
- p To compare moment.js date formatting speeds against other libraries, check out
- a(href="http://jsperf.com/date-formatting") http://jsperf.com/date-formatting
- | .
- p Note: Baron Schwartz wrote a pretty cool date formatter that caches formatting functions to avoid expensive regex or string splitting. It's so much faster than any of the other libraries, that it's best to compare it on its own, rather than pollute the "best of the uncompiled" formatting libs.
- p Here's the
- a(href="http://jsperf.com/momentjs-vs-xaprb") moment.js vs xaprb
- | performance tests, and here is the
- a(href="http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/") article describing his methods.
- p If you are more comfortable working with strftime instead of LDML-like parsing tokens, you can use Ben Oakes' plugin
- code moment-strftime
- | .
- p It is available on npm.
- pre npm install moment-strftime
- p The repository is located at
- a(href="https://github.com/benjaminoakes/moment-strftime") benjaminoakes/moment-strftime
-
-
- a(name="/display/from")
- h3
- span Time from another moment
- p Another common way of displaying time, sometimes called timeago, is handled by
- code moment.fn.from
- | .
- pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);
- | a.from(b) // "a day ago"
- p The first parameter is anything you can pass to
- code moment()
- | or a Moment.js object.
- pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);
- | a.from(b); // "a day ago"
- | a.from([2007, 0, 28]); // "a day ago"
- | a.from(new Date(2007, 0, 28)); // "a day ago"
- | a.from("1-28-2007"); // "a day ago"
- p NOTE: Because it only accepts one parameter to pass in the date info,
- | if you need to use String + Format or String + Formats, you should create a Moment.js
- | object first and then call
- code moment.fn.from
- pre var a = moment();\n
- | var b = moment("10-10-1900", "MM-DD-YYYY");
- | a.from(b);
- p If you pass
- code true
- | as the second parameter, you can get the value without the suffix. This is useful wherever you need to have a human readable length of time.
- pre var start = moment([2007, 0, 5]);\n
- | var end = moment([2007, 0, 10]);
- | start.from(end); // "in 5 days"
- | start.from(end, true); // "5 days"
- p The base strings are customized by
- code moment.lang
- | or by modifying the values directly using
- code moment.relativeTime
- | .
- p The breakdown of which string is displayed when is outlined in the table below.
- table
- thead
- tr
- th Range
- th Key
- th Sample Output
- tbody
- tr
- td 0 to 45 seconds
- td s
- td seconds ago
- tr
- td 45 to 90 seconds
- td m
- td a minute ago
- tr
- td 90 seconds to 45 minutes
- td mm
- td 2 minutes ago ... 45 minutes ago
- tr
- td 45 to 90 minutes
- td h
- td an hour ago
- tr
- td 90 minutes to 22 hours
- td hh
- td 2 hours ago ... 22 hours ago
- tr
- td 22 to 36 hours
- td d
- td a day ago
- tr
- td 36 hours to 25 days
- td dd
- td 2 days ago ... 25 days ago
- tr
- td 25 to 45 days
- td M
- td a month ago
- tr
- td 45 to 345 days
- td MM
- td 2 months ago ... 11 months ago
- tr
- td 345 to 547 days (1.5 years)
- td y
- td a year ago
- tr
- td 548 days+
- td yy
- td 2 years ago ... 20 years ago
-
-
- a(name="/display/fromNow")
- h3
- span Time from now
- p This is just a map to
- code moment.fn.from(new Date())
- pre moment([2007, 0, 29]).fromNow(); // 4 years ago
- p Like
- code moment.fn.from
- | , if you pass
- code true
- | as the second parameter, you can get the value without the suffix.
- pre moment([2007, 0, 29]).fromNow(); // 4 years ago\n
- | moment([2007, 0, 29]).fromNow(true); // 4 years
-
-
- a(name="/display/calendar")
- h3
- span Calendar time
- p Calendar time is displays time relative to now, but slightly differently than
- code moment.fn.from
- | .
- p
- code moment.fn.calendar
- | will format a date with different strings depending on how close to today the date is.
- table
- tr
- td Last week
- td Last Monday 2:30 AM
- tr
- td The day before
- td Yesterday 2:30 AM
- tr
- td The same day
- td Today 2:30 AM
- tr
- td The next day
- td Tomorrow 2:30 AM
- tr
- td The next week
- td Sunday 2:30 AM
- tr
- td Everything else
- td 7/10/2011
- p These strings are localized, and can be customized with
- a(href="#/custom/calendar") moment.calendar
- | or
- a(href="#/i18n/lang") moment.lang
- | .
-
-
- a(name="/display/diff")
- h3
- span Difference
- p To get the difference in milliseconds, use
- code moment.fn.diff
- | like you would use
- code moment.fn.from
- | .
- pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);
- | a.diff(b) // 86400000
- p To get the difference in another unit of measurement, pass that measurement as the second argument.
- pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);
- | a.diff(b, 'days') // 1
- p The supported measurements are
- code "years", "months", "weeks", "days", "hours", "minutes", and "seconds"
- p By default,
- code moment.fn.diff
- | will return a rounded number. If you want the floating point number, pass
- code true
- | as the third argument.
- pre var a = moment([2007, 0]);\n
- | var b = moment([2008, 5]);
- | a.diff(b, 'years') // 1
- | a.diff(b, 'years', true) // 1.5
-
-
- a(name="/display/toDate")
- a(name="/display/native")
- h3
- span Native Javascript Date
- p To get the native Date object that Moment.js wraps, use
- code moment.fn.toDate
- | .
- pre moment([2007, 0, 29]).toDate(); // returns native Date object
- p Note:
- code moment.fn.native
- | has been replaced by
- code moment.fn.toDate
- | and will be depreciated in the future.
-
-
- a(name="/display/valueOf")
- h3
- span Value
- p
- code moment.fn.valueOf
- | simply outputs the unix timestamp.
- pre moment(1318874398806).valueOf(); // 1318874398806
-
-
- a(name="/display/milliseconds")
- h3
- span Milliseconds
- p These are the getters mentioned in the
- a(href="#/manipulation/milliseconds") Manipulation
- | section above.
- p These map to the corresponding function on the native
- code Date
- | object.
- pre moment().milliseconds() === new Date().getMilliseconds();
- pre moment().milliseconds(); // get the milliseconds (0 - 999)
-
-
- a(name="/display/seconds")
- h3
- span Seconds
- pre moment().minutes(); // get the seconds (0 - 59)
-
-
- a(name="/display/minutes")
- h3
- span Minutes
- pre moment().minutes(); // get the minutes (0 - 59)
-
-
- a(name="/display/hours")
- h3
- span Hours
- pre moment().hours(); // get the hours (0 - 23)
-
-
- a(name="/display/date")
- h3
- span Date
- pre moment().date(); // get the date of the month (1 - 31)
-
-
- a(name="/display/day")
- h3
- span Day
- pre moment().day(); // get the day of the week (0 - 6)
-
-
- a(name="/display/month")
- h3
- span Month
- pre moment().month(); // get the month (0 - 11)
-
-
- a(name="/display/year")
- h3
- span Year
- pre moment().year(); // get the four digit year
-
-
- a(name="/display/leapyear")
- h3
- span Leap Year
- p
- code moment.fn.isLeapYear
- | returns true if that year is a leap year, and false if it is not.
- pre moment([2000]).isLeapYear() // true\n
- | moment([2001]).isLeapYear() // false
- | moment([2100]).isLeapYear() // false
-
-
- a(name="/display/zone")
- h3
- span Timezone Offset
- pre moment().zone(); // get the timezone offset in minutes (60, 120, 240, etc.)
-
-
- a(name="/display/dst")
- h3
- span Daylight Savings Time
- p
- code moment.fn.isDST
- | checks if the current moment is in daylight savings time or not.
- pre moment([2011, 2, 12]).isDST(); // false, March 12 2011 is not DST\n
- | moment([2011, 2, 14]).isDST(); // true, March 14 2011 is DST
-
-
- a(name="/i18n")
- h2
- span I18N
- p Moment.js has pretty robust support for internationalization. You can load multiple languages onto the same instance and easily switch between them.
-
-
- a(name="/i18n/lang")
- h3
- span Changing languages
- p By default, Moment.js comes with English language strings. If you need other languages, you can load them into Moment.js for later use.
- p To load a language, pass the key and the string values to
- code moment.lang
- | .
- p Note: More details on each of the parts of the language bundle can be found in the
- a(href="#/custom") customization
- | section.
- pre moment.lang('fr', {\n
- | months : "Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),
- | monthsShort : "Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),
- | weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),
- | weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),
- | longDateFormat : {
- | L : "DD/MM/YYYY",
- | LL : "D MMMM YYYY",
- | LLL : "D MMMM YYYY HH:mm",
- | LLLL : "dddd, D MMMM YYYY HH:mm"
- | },
- | meridiem : {
- | AM : 'AM',
- | am : 'am',
- | PM : 'PM',
- | pm : 'pm'
- | },
- | calendar : {
- | sameDay: "[Ajourd'hui à] LT",
- | nextDay: '[Demain à] LT',
- | nextWeek: 'dddd [à] LT',
- | lastDay: '[Hier à] LT',
- | lastWeek: 'dddd [denier à] LT',
- | sameElse: 'L'
- | },
- | relativeTime : {
- | future : "in %s",
- | past : "il y a %s",
- | s : "secondes",
- | m : "une minute",
- | mm : "%d minutes",
- | h : "une heure",
- | hh : "%d heures",
- | d : "un jour",
- | dd : "%d jours",
- | M : "un mois",
- | MM : "%d mois",
- | y : "une année",
- | yy : "%d années"
- | },
- | ordinal : function (number) {
- | return (~~ (number % 100 / 10) === 1) ? 'er' : 'ème';
- | }
- | });
- p Once you load a language, it becomes the active language. To change active languages, simply call
- code moment.lang
- | with the key of a loaded language.
- pre moment.lang('fr');\n
- | moment(1316116057189).fromNow() // il y a une heure
- | moment.lang('en');
- | moment(1316116057189).fromNow() // an hour ago
-
-
- a(name="/i18n/node")
- h3
- span Loading languages in NodeJS
- p Loading languages in NodeJS is super easy. If there is a language file in
- code moment/lang/
- | named after that key, the first call to
- code moment.lang
- | will load it.
- pre var moment = require('moment');\n
- | moment.lang('fr');
- | moment(1316116057189).fromNow(); // il y a une heure
- p Right now, there is only support for English, French, Italian, and Portuguese.
- | If you want your language supported, create a pull request or send me an email with the
- a(href="#/i18n/add") required files
- | .
-
-
- a(name="/i18n/browser")
- h3
- span Loading languages in the browser
- p Loading languages in the browser just requires you to include the language files.
- pre <script src="moment.min.js"></script>\n
- | <script src="lang/fr.js"></script>
- | <script src="lang/pt.js"></script>
- p There are minified versions of each of these languages. There is also a minified version of all of the languages bundled together.
- pre <script src="moment.min.js"></script>
- | <script src="lang/all.min.js"></script>
- p Ideally, you would bundle all the files you need into one file to minimize http requests.
- pre <script src="moment-fr-it.min.js"></script>
-
-
- a(name="/i18n/add")
- h3
- span Adding your language to Moment.js
- p To add your language to Moment.js, submit a pull request with both a language file and a test file. You can find examples in
- code moment/lang/fr.js
- | and
- code moment/test/lang/fr.js
- p To run the tests, do
- code node build
- | .
- p If there are no errors building, then do
- code node test
- | or open
- code moment/test/index.html
- | .
- p If all the tests pass, submit that pull request, and thank you for contributing!
-
-
- a(name="/custom")
- h2
- span Customization
- p If you don't need i18n support, you can manually override the customization values.
- | However, any calls to
- code moment.lang
- | will override them. It is probably safer to create a language for your specific customizations than to override these values manually.
-
-
- a(name="/custom/months")
- h3
- span Month Names
- p
- code moment.months
- | should be an array of the month names.
- pre moment.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-
-
- a(name="/custom/monthsShort")
- h3
- span Month Abbreviations
- p
- code moment.monthsShort
- | should be an array of the month abbreviations.
- pre moment.monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
-
-
- a(name="/custom/weekdays")
- h3
- span Weekday Names
- p
- code moment.weekdays
- | should be an array of the weekdays names.
- pre moment.weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
-
-
- a(name="/custom/weekdaysShort")
- h3
- span Weekday Abbreviations
- p
- code moment.weekdaysShort
- | should be an array of the weekdays abbreviations.
- pre moment.weekdaysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
-
-
- a(name="/custom/longDateFormats")
- h3
- span Long Date Formats
- p
- code moment.longDateFormat
- | should be an object containing a key/value pair for each long date format (L, LL, LLL, LLLL).
- pre moment.longDateFormat = { \n
- | L: "MM/DD/YYYY",
- | LL: "MMMM D YYYY",
- | LLL: "MMMM D YYYY h:mm A",
- | LLLL: "dddd, MMMM D YYYY h:mm A"
- | };
-
-
- a(name="/custom/relativeTime")
- h3
- span Relative Time
- p
- code moment.relativeTime
- | should be an object of the replacement strings for
- code moment.fn.from
- | .
- pre moment.relativeTime = {\n
- | future: "in %s",
- | past: "%s ago",
- | s: "seconds",
- | m: "a minute",
- | mm: "%d minutes",
- | h: "an hour",
- | hh: "%d hours",
- | d: "a day",
- | dd: "%d days",
- | M: "a month",
- | MM: "%d months",
- | y: "a year",
- | yy: "%d years"
- | };
- p
- code future
- | refers to the prefix/suffix for future dates, and
- code past
- | refers to the prefix/suffix for past dates. For all others, a single character refers to the singular, and an double character refers to the plural.
- p If a language requires additional processing for a token, It can set the token as a function with the following signature.
- | The function should return a string.
- pre function(number, withoutSuffix, key) {\n
- | return string;
- | }
- p The
- code key
- | variable refers to the replacement key in the
- code relativeTime
- | object. (eg. 's', 'm', 'mm', 'h', etc.)
- p The
- code number
- | variable refers to the number of units for that key. For 'm', the number is the number of minutes, etc.
- p The
- code withoutSuffix
- | variable will be true if the token will be displayed without a suffix, and false if it will be displayed with a suffix.
- | (The reason for the inverted logic is because the default behavior is to display with the suffix.)
-
-
- a(name="/custom/meridiem")
- h3
- span AM/PM
- p
- code moment.meridiem
- | should be a map of upper and lowercase versions of am/pm.
- pre moment.meridiem = {\n
- | am : 'am',
- | AM : 'AM',
- | pm : 'pm',
- | PM : 'PM'
- | };
-
-
- a(name="/custom/calendar")
- h3
- span Calendar
- p
- code moment.calendar
- | should have the following formatting strings.
- pre moment.calendar = {\n
- | lastDay : '[Yesterday at] LT',
- | sameDay : '[Today at] LT',
- | nextDay : '[Tomorrow at] LT',
- | lastWeek : '[last] dddd [at] LT',
- | nextWeek : 'dddd [at] LT',
- | sameElse : 'L'
- | };
-
-
- a(name="/custom/ordinal")
- h3
- span Ordinal
- p
- code moment.ordinal
- | should be a function that returns the ordinal for a given number.
- pre moment.ordinal = function (number) {\n
- | var b = number % 10;
- | return (~~ (number % 100 / 10) === 1) ? 'th' :
- | (b === 1) ? 'st' :
- | (b === 2) ? 'nd' :
- | (b === 3) ? 'rd' : 'th';
- | };
- p For more information on ordinal numbers, see
- a(href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29") wikipedia
-
-
- a(name="/plugins")
- h2
- span Plugins
- p Some people have made plugins for moment.js that may be useful to you.
-
-
- a(name="/plugins/strftime")
- h3
- span strftime
- p If you are more comfortable working with strftime instead of LDML-like parsing tokens, you can use Ben Oakes' plugin
- code moment-strftime
- | .
- p It is available on npm.
- pre npm install moment-strftime
- p The repository is located at
- a(href="https://github.com/benjaminoakes/moment-strftime") benjaminoakes/moment-strftime
-
-
- .footer
\ No newline at end of file
+++ /dev/null
-extends html
-
-block styles
- link(rel="stylesheet", href="css/style.css?_=" + builddate)
- title Moment.js - A lightweight javascript date library
-
-block scripts
- script(src="js/home.min.js?_=" + builddate)
-
-block content
- #home
- h2 Moment.js
- h3 A lightweight javascript date library for parsing, manipulating, and formatting dates.
- .col1
- h4
- span Get it
- pre npm install moment
- a.btn.cupid-green(href="https://raw.github.com/timrwood/moment/" + version + "/moment.min.js")
- strong Production
- span.version= 'Version ' + version
- span.filesize= minsize + ' minified & gzipped'
- a.btn.minimal(href="https://raw.github.com/timrwood/moment/" + version + "/moment.js")
- strong Development
- span.version= 'Version ' + version
- span.filesize= srcsize + ' full source + comments'
- .col2
- h4
- span Use it
- pre.js var now = moment();\n
- | console.log(now.format('dddd, MMMM Do YYYY, h:mm:ss a'));
- h5
- span#js-format-now
- pre.js var halloween = moment([2011, 9, 31]); // October 31st\n
- | console.log(halloween.fromNow());
- h5
- span#js-from-now
- pre.js var now = moment().add('days', 9);\n
- | console.log(now.format('dddd, MMMM Do YYYY'));
- h5
- span#js-add
- pre.js var now = moment();\n
- | moment.lang('fr');
- | console.log(now.format('LLLL'));
- h5
- span#js-lang
+++ /dev/null
-!!! 5
-html
- head
- meta(charset="utf-8")
- link(href="http://fonts.googleapis.com/css?family=Oswald", rel="stylesheet")
- block styles
- body
- #navwrap
- #nav
- h1 Moment.js
- ul
- li
- a.btn.clean-gray(href="/") Home
- li
- a.btn.clean-gray(href="/docs/") Documentation
- li
- a.btn.clean-gray(href="/test/") Unit Tests
- li
- a.btn.clean-gray(href="https://github.com/timrwood/moment") Github
- #content
- block content
- script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js")
- block scripts
- script
- window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
- (function(d, c) {
- var ga = d.createElement(c); ga.async = true;
- ga.src = "http://www.google-analytics.com/ga.js";
- var s = d.getElementsByTagName(c)[0];
- s.parentNode.insertBefore(ga, s);
- })(document, 'script');
+++ /dev/null
-$("pre").snippet("javascript", {style:"typical",showNum:false});
\ No newline at end of file
+++ /dev/null
-$("pre.js").snippet("javascript", {style:"typical",showNum:false});
-moment.lang('en');
-$('#js-format-now').html('"' + moment().format('dddd, MMMM Do YYYY, h:mm:ss a') + '"');
-$('#js-from-now').html('"' + moment([2011, 9, 31]).fromNow() + '"');
-$('#js-add').html('"' + moment().add('days', 9).format('dddd, MMMM Do YYYY') + '"');
-moment.lang('fr');
-$('#js-lang').html('"' + moment().format('LLLL') + '"');
-moment.lang('en');
\ No newline at end of file
+++ /dev/null
-(function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }
-/**************************************************
- Català
- *************************************************/
-
-module("lang:ca");
-
-test("parse", 96, function() {
- moment.lang('ca');
-
- var tests = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ca');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('ca');
- var expected = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ca');
- var expected = "Diumenge Dg._Dilluns Dl._Dimarts Dt._Dimecres Dc._Dijous Dj._Divendres Dv._Dissabte Ds.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ca');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segons", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuts", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuts", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hores", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hores", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hores", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dies", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dies", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dies", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesos", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesos", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesos", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesos", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesos", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un any", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un any", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anys", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un any", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anys", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ca');
- equal(moment(30000).from(0), "en uns segons", "prefix");
- equal(moment(0).from(30000), "fa uns segons", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('ca');
- equal(moment().fromNow(), "fa uns segons", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('ca');
- equal(moment().add({s:30}).fromNow(), "en uns segons", "en uns segons");
- equal(moment().add({d:5}).fromNow(), "en 5 dies", "en 5 dies");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('ca');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "avui a les 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "avui a les 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "avui a les 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "demá a les 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "demá a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "avui a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ahir a les 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ca');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ca');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ca');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- German
- *************************************************/
-
-module("lang:de");
-
-test("parse", 96, function() {
- moment.lang('de');
- var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('de');
- var a = [
- ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],
- ['ddd, hA', 'So., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. Sonntag So.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14. Februar 2010'],
- ['LLL', '14. Februar 2010 15:25 Uhr'],
- ['LLLL', 'Sonntag, 14. Februar 2010 15:25 Uhr']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('de');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('de');
- var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('de');
- var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('de');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('de');
- equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
- equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('de');
- equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('de');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Heute um 2:00 Uhr", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Heute um 2:25 Uhr", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Heute um 3:00 Uhr", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 2:00 Uhr", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 1:00 Uhr", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 2:00 Uhr", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('de');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('de');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('de');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en");
-
-test("parse", 96, function() {
- moment.lang('en');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '02/14/2010'],
- ['LL', 'February 14 2010'],
- ['LLL', 'February 14 2010 3:25 PM'],
- ['LLLL', 'Sunday, February 14 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('en');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:en-gb");
-
-test("parse", 96, function() {
- moment.lang('en-gb');
- var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('en-gb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Sun, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Sunday Sun'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 February 2010'],
- ['LLL', '14 February 2010 3:25 PM'],
- ['LLLL', 'Sunday, 14 February 2010 3:25 PM']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('en-gb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('en-gb');
- var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('en-gb');
- var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('en-gb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('en-gb');
- equal(moment(30000).from(0), "in a few seconds", "prefix");
- equal(moment(0).from(30000), "a few seconds ago", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('en-gb');
- equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('en-gb');
- equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('en-gb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Today at 2:00 AM", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Today at 2:25 AM", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Today at 3:00 AM", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Tomorrow at 2:00 AM", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Today at 1:00 AM", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Yesterday at 2:00 AM", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('en-gb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('en-gb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('en-gb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Spanish
- *************************************************/
-
-module("lang:es");
-
-test("parse", 96, function() {
- moment.lang('es');
- var tests = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('es');
- var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('es');
- var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('es');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('es');
- equal(moment(30000).from(0), "en unos segundos", "prefix");
- equal(moment(0).from(30000), "hace unos segundos", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('es');
- equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('es');
- equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('es');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoy a las 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoy a las 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoy a las 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañana a las 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañana a la 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoy a la 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "ayer a las 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('es');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('es');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('es');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Euskara
- *************************************************/
-
-module("lang:eu");
-
-test("parse", 96, function() {
- moment.lang('eu');
- var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('eu');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'ig., 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. igandea ig.'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '2010ko otsailaren 14a'],
- ['LLL', '2010ko otsailaren 14a 15:25'],
- ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('eu');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('eu');
- var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('eu');
- var expected = 'igandea ig._astelehena al._asteartea ar._asteazkena az._osteguna og._ostirala ol._larunbata lr.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('eu');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundo batzuk", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minutu bat", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minutu bat", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutu", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutu", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "ordu bat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "ordu bat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ordu", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ordu", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ordu", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egun bat", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egun bat", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 egun", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egun bat", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 egun", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 egun", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "hilabete bat", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "hilabete bat", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "hilabete bat", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hilabete", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hilabete", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hilabete", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "hilabete bat", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hilabete", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hilabete", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "urte bat", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "urte bat", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 urte", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "urte bat", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 urte", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('eu');
- equal(moment(30000).from(0), "segundo batzuk barru", "prefix");
- equal(moment(0).from(30000), "duela segundo batzuk", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('eu');
- equal(moment().fromNow(), "duela segundo batzuk", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('eu');
- equal(moment().add({s:30}).fromNow(), "segundo batzuk barru", "in seconds");
- equal(moment().add({d:5}).fromNow(), "5 egun barru", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('eu');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "gaur 02:00etan", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "gaur 02:25etan", "now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "gaur 03:00etan", "now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "bihar 02:00etan", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "gaur 01:00etan", "now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "atzo 02:00etan", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('eu');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('eu');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('eu');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- French
- *************************************************/
-
-module("lang:fr");
-
-test("parse", 96, function() {
- moment.lang('fr');
- var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('fr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
- ['ddd, hA', 'dim., 3PM'],
- ['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14ème 14'],
- ['d do dddd ddd', '0 0ème dimanche dim.'],
- ['DDD DDDo DDDD', '45 45ème 045'],
- ['w wo ww', '8 8ème 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 février 2010'],
- ['LLL', '14 février 2010 15:25'],
- ['LLLL', 'dimanche 14 février 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('fr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
- equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
- equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
- equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
- equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
- equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
- equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
- equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
- equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
- equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
- equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
- equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
- equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
- equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
- equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
- equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
- equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
-});
-
-test("format month", 12, function() {
- moment.lang('fr');
- var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('fr');
- var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('fr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('fr');
- equal(moment(30000).from(0), "dans quelques secondes", "prefix");
- equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('fr');
- equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
-});
-
-
-test("same day", 6, function() {
- moment.lang('fr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Ajourd'hui à 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Ajourd'hui à 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Ajourd'hui à 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Demain à 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Ajourd'hui à 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Hier à 02:00", "yesterday at the same time");
-});
-
-test("same next week", 15, function() {
- moment.lang('fr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("same last week", 15, function() {
- moment.lang('fr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("same all else", 4, function() {
- moment.lang('fr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Galego
- *************************************************/
-
-module("lang:gl");
-
-test("parse", 96, function() {
- moment.lang('gl');
- var tests = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
-
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('es');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('gl');
- var expected = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('gl');
- var expected = "Domingo Dom._Luns Lun._Martes Mar._Mércores Mér._Xoves Xov._Venres Ven._Sábado Sáb.".split("_");
-
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('gl');
- var start = moment([2007, 1, 28]);
-
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segundo", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "unha hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "unha hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('gl');
- equal(moment(30000).from(0), "en uns segundo", "prefix");
- equal(moment(0).from(30000), "fai uns segundo", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('gl');
- equal(moment().fromNow(), "fai uns segundo", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('gl');
- equal(moment().add({s:30}).fromNow(), "en uns segundo", "en unos segundos");
- equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
-});
-
-
-test("calendar day", 7, function() {
- moment.lang('gl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "hoxe ás 2:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "hoxe ás 2:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "hoxe ás 3:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "mañá ás 2:00", "tomorrow at the same time");
- equal(moment(a).add({ d: 1, h : -1 }).calendar(), "mañá a 1:00", "tomorrow minus 1 hour");
- equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe a 1:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('gl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- 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);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('gl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('gl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Italian
- *************************************************/
-
-module("lang:it");
-
-test("parse", 96, function() {
- moment.lang('it');
- var tests = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('it');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, Febbraio 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Febbraio Feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domenica Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 Febbraio 2010'],
- ['LLL', '14 Febbraio 2010 15:25'],
- ['LLLL', 'Domenica, 14 Febbraio 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('it');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('it');
- var expected = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('it');
- var expected = 'Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('it');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondi", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuti", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuti", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "un ora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "un ora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ore", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ore", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ore", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un giorno", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un giorno", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 giorni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un giorno", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 giorni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 giorni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mese", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mese", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mese", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesi", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesi", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesi", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mese", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesi", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesi", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un anno", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un anno", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anni", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un anno", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anni", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('it');
- equal(moment(30000).from(0), "in secondi", "prefix");
- equal(moment(0).from(30000), "secondi fa", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('it');
- equal(moment().add({s:30}).fromNow(), "in secondi", "in seconds");
- equal(moment().add({d:5}).fromNow(), "in 5 giorni", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('it');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Oggi alle 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Oggi alle 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Oggi alle 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Domani alle 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Oggi alle 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ieri alle 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('it');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('it');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('it');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-
-/**************************************************
- Korean
- *************************************************/
-
-module("lang:kr");
-
-test("format", 18, function() {
- moment.lang('kr');
- var a = [
- ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
- ['ddd A h', '일 오후 3'],
- ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14일 14'],
- ['d do dddd ddd', '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', '2010.02.14'],
- ['LL', '2010년 2월 14일'],
- ['LLL', '2010년 2월 14일 오후 3시 25분'],
- ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('kr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
- equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
- equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
- equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
- equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
- equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
- equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
- equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
- equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
- equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
- equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
- equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
- equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
- equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
- equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
- equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
- equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
- equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
- equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
- equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
- equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
- equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
- equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
- equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
- equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
- equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
- equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
- equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
-});
-
-test("format month", 12, function() {
- moment.lang('kr');
- var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('kr');
- var expected = '일요일 일_월요일 월_화요일 화_수요일 수_목요일 목_금요일 금_토요일 토'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('kr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
-});
-
-test("suffix", 2, function() {
- moment.lang('kr');
- equal(moment(30000).from(0), "몇초 후", "prefix");
- equal(moment(0).from(30000), "몇초 전", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('kr');
- equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('kr');
- equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('kr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "오늘 오전 2시 00분", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "오늘 오전 2시 25분", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "오늘 오전 3시 00분", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "내일 오전 2시 00분", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "오늘 오전 1시 00분", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "어제 오전 2시 00분", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('kr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('kr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('kr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-
-/**************************************************
- Norwegian bokmål
- *************************************************/
-
-module("lang:nb");
-
-test("parse", 96, function() {
- moment.lang('nb');
- var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nb');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'søn, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 februar feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. søndag søn'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februar 2010'],
- ['LLL', '14 februar 2010 15:25'],
- ['LLLL', 'søndag 14 februar 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nb');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('nb');
- var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nb');
- var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nb');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nb');
- equal(moment(30000).from(0), "om noen sekunder", "prefix");
- equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nb');
- equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nb');
- equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nb');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "I dag klokken 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "I dag klokken 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "I dag klokken 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "I morgen klokken 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokken 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokken 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nb');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nb');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nb');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Dutch
- *************************************************/
-
-module("lang:nl");
-
-test("parse", 96, function() {
- moment.lang('nl');
- var tests = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('nl');
- var a = [
- ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'],
- ['ddd, HH', 'zo., 15'],
- ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14de 14'],
- ['d do dddd ddd', '0 0de zondag zo.'],
- ['DDD DDDo DDDD', '45 45ste 045'],
- ['w wo ww', '8 8ste 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ste day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'zondag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('nl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
- equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');
- equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');
- equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');
- equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');
- equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');
- equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');
- equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');
- equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');
- equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');
- equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');
- equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');
- equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');
- equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');
- equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');
- equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');
- equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');
- equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');
- equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');
- equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');
- equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');
- equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');
- equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');
- equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');
- equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');
- equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');
- equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');
- equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');
-});
-
-test("format month", 12, function() {
- moment.lang('nl');
- var expected = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('nl');
- var expected = 'zondag zo._maandag ma._dinsdag di._woensdag wo._donderdag do._vrijdag vr._zaterdag za.'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('nl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "een paar seconden", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "één minuut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "één minuut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuten", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuten", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "één uur", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "één uur", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 uur", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 uur", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 uur", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "één dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "één dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagen", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "één dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagen", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagen", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "één maand", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "één maand", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "één maand", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 maanden", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 maanden", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 maanden", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "één maand", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 maanden", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 maanden", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "één jaar", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "één jaar", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 jaar", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "één jaar", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaar", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('nl');
- equal(moment(30000).from(0), "over een paar seconden", "prefix");
- equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('nl');
- equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('nl');
- equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('nl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Vandaag om 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Vandaag om 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Vandaag om 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Morgen om 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Vandaag om 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Gisteren om 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('nl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('nl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('nl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Polish
- *************************************************/
-
-module("lang:pl");
-
-test("parse", 96, function() {
- moment.lang('pl');
- var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pl');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'],
- ['ddd, hA', 'nie, 3PM'],
- ['M Mo MM MMMM MMM', '2 2. 02 luty lut'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14. 14'],
- ['d do dddd ddd', '0 0. niedziela nie'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-2010'],
- ['LL', '14 luty 2010'],
- ['LLL', '14 luty 2010 15:25'],
- ['LLLL', 'niedziela, 14 luty 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pl');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('pl');
- var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pl');
- var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pl');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pl');
- equal(moment(30000).from(0), "za kilka sekund", "prefix");
- equal(moment(0).from(30000), "kilka sekund temu", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('pl');
- equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
-});
-
-
-test("fromNow", 3, function() {
- moment.lang('pl');
- equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
- equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
- equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
-});
-
-
-
-test("calendar day", 6, function() {
- moment.lang('pl');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Dziś o 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Dziś o 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Dziś o 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Jutro o 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Dziś o 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Wczoraj o 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pl');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pl');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pl');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Portuguese
- *************************************************/
-
-module("lang:pt");
-
-test("parse", 96, function() {
- moment.lang('pt');
- var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('pt');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
- ['ddd, hA', 'Dom, 3PM'],
- ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14º 14'],
- ['d do dddd ddd', '0 0º Domingo Dom'],
- ['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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
- ['L', '14/02/2010'],
- ['LL', '14 de Fevereiro de 2010'],
- ['LLL', '14 de Fevereiro de 2010 15:25'],
- ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('pt');
- equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
- equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
- equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
- equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
- equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
- equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
- equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
- equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
- equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
- equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
- equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
- equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
- equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
- equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
- equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
- equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
- equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
- equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
- equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
- equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
- equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
- equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
- equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
- equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
- equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
- equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
- equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
- equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
-});
-
-test("format month", 12, function() {
- moment.lang('pt');
- var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('pt');
- var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('pt');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('pt');
- equal(moment(30000).from(0), "em segundos", "prefix");
- equal(moment(0).from(30000), "segundos atrás", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('pt');
- equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
- equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('pt');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Hoje às 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Hoje às 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Hoje às 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Amanhã às 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Hoje às 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Ontem às 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('pt');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('pt');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- 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");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('pt');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- Russian
- *************************************************/
-
-module("lang:ru");
-
-test("parse", 96, function() {
- moment.lang('ru');
- var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('ru');
- 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', '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', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
- ['L', '14-02-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++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('ru');
- equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
- equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
- equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
- equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
- equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
- equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
- equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
- equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
- equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
- equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
- equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
- equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
- equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
- equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
- equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
- equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
- equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
- equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
- equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
- equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
- equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
- equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
- equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
- equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
- equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
- equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
- equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
- equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
-});
-
-test("format month", 12, function() {
- moment.lang('ru');
- var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('ru');
- var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('ru');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "минут", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "минут", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 минут", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "часа", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "часа", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 часов", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "месяц", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "месяц", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "месяц", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "месяц", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 месяцев", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "год", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "год", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "год", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 лет", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('ru');
- equal(moment(30000).from(0), "через несколько секунд", "prefix");
- equal(moment(0).from(30000), "несколько секунд назад", "suffix");
-});
-
-test("fromNow", 2, function() {
- moment.lang('ru');
- equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
- equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('ru');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Сегодня в 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Сегодня в 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Сегодня в 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Завтра в 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Сегодня в 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Вчера в 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- return d.day() === 1 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('ru');
-
- var i;
- var m;
-
- function makeFormat(d) {
- switch (d.day()) {
- case 0:
- case 1:
- case 3:
- return '[В прошлый] dddd [в] LT';
- case 6:
- return '[В прошлое] dddd [в] LT';
- default:
- return '[В прошлую] dddd [в] LT';
- }
- }
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('ru');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-
-/**************************************************
- English
- *************************************************/
-
-module("lang:sv");
-
-test("parse", 96, function() {
- moment.lang('sv');
- var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('sv');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'söndag, februari 14e 2010, 3:25:50 pm'],
- ['ddd, hA', 'sön, 3PM'],
- ['M Mo MM MMMM MMM', '2 2a 02 februari feb'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14e 14'],
- ['d do dddd ddd', '0 0e söndag sön'],
- ['DDD DDDo DDDD', '45 45e 045'],
- ['w wo ww', '8 8e 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45e day of the year'],
- ['L', '2010-02-14'],
- ['LL', '14 februari 2010'],
- ['LLL', '14 februari 2010 15:25'],
- ['LLLL', 'söndag 14 februari 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('sv');
- equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
- equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');
- equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e');
- equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e');
- equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e');
- equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e');
- equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e');
- equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e');
- equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e');
- equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e');
- equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e');
- equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e');
- equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e');
- equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e');
- equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e');
- equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e');
- equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e');
- equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e');
- equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');
- equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');
- equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e');
- equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e');
- equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e');
- equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e');
- equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e');
- equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e');
- equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e');
- equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');
-});
-
-test("format month", 12, function() {
- moment.lang('sv');
- var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('sv');
- var expected = 'söndag sön_måndag mån_tisdag tis_onsdag ons_torsdag tor_fredag fre_lördag lör'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('sv');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "några sekunder", "44 sekunder = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "en minut", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "en minut", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuter", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuter", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en timme", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en timme", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timmar", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timmar", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timmar", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagar", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagar", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagar", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en månad", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en månad", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en månad", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 månader", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 månader", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 månader", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en månad", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 månader", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 månader", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('sv');
- equal(moment(30000).from(0), "om några sekunder", "prefix");
- equal(moment(0).from(30000), "för några sekunder sen", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('sv');
- equal(moment().fromNow(), "för några sekunder sen", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('sv');
- equal(moment().add({s:30}).fromNow(), "om några sekunder", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
-});
-
-test("calendar day", 6, function() {
- moment.lang('sv');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "Idag klockan 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "Idag klockan 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "Idag klockan 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "Imorgon klockan 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "Idag klockan 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "Igår klockan 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('sv');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('sv');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('sv');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-/**************************************************
- Turkish
- *************************************************/
-
-module("lang:tr");
-
-test("parse", 96, function() {
- moment.lang('tr');
- var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- function equalTest(input, mmm, i) {
- equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
- }
- for (i = 0; i < 12; i++) {
- tests[i] = tests[i].split(' ');
- equalTest(tests[i][0], 'MMM', i);
- equalTest(tests[i][1], 'MMM', i);
- equalTest(tests[i][0], 'MMMM', i);
- equalTest(tests[i][1], 'MMMM', i);
- equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
- equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
- equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
- }
-});
-
-test("format", 18, function() {
- moment.lang('tr');
- var a = [
- ['dddd, MMMM Do YYYY, h:mm:ss a', 'Pazar, Şubat 14th 2010, 3:25:50 pm'],
- ['ddd, hA', 'Paz, 3PM'],
- ['M Mo MM MMMM MMM', '2 2nd 02 Şubat Şub'],
- ['YYYY YY', '2010 10'],
- ['D Do DD', '14 14th 14'],
- ['d do dddd ddd', '0 0th Pazar Paz'],
- ['DDD DDDo DDDD', '45 45th 045'],
- ['w wo ww', '8 8th 08'],
- ['h hh', '3 03'],
- ['H HH', '15 15'],
- ['m mm', '25 25'],
- ['s ss', '50 50'],
- ['a A', 'pm PM'],
- ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
- ['L', '14.02.2010'],
- ['LL', '14 Şubat 2010'],
- ['LLL', '14 Şubat 2010 15:25'],
- ['LLLL', 'Pazar, 14 Şubat 2010 15:25']
- ],
- b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
- i;
- for (i = 0; i < a.length; i++) {
- equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("format ordinal", 31, function() {
- moment.lang('tr');
- equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
- equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
- equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
- equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
- equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
- equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
- equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
- equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
- equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
- equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
-
- equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
- equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
- equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
- equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
- equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
- equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
- equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
- equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
- equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
- equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
-
- equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
- equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
- equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
- equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
- equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
- equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
- equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
- equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
- equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
- equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
-
- equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
-});
-
-test("format month", 12, function() {
- moment.lang('tr');
- var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
- }
-});
-
-test("format week", 7, function() {
- moment.lang('tr');
- var expected = 'Pazar Paz_Pazartesi Pts_Salı Sal_Çarşamba Çar_Perşembe Per_Cuma Cum_Cumartesi Cts'.split("_");
- var i;
- for (i = 0; i < expected.length; i++) {
- equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
- }
-});
-
-test("from", 30, function() {
- moment.lang('tr');
- var start = moment([2007, 1, 28]);
- equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "birkaç saniye", "44 seconds = a few seconds");
- equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "bir dakika", "45 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "bir dakika", "89 seconds = a minute");
- equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 dakika", "90 seconds = 2 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 dakika", "44 minutes = 44 minutes");
- equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "bir saat", "45 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "bir saat", "89 minutes = an hour");
- equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 saat", "90 minutes = 2 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 saat", "5 hours = 5 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 saat", "21 hours = 21 hours");
- equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "bir gün", "22 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "bir gün", "35 hours = a day");
- equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 gün", "36 hours = 2 days");
- equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "bir gün", "1 day = a day");
- equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 gün", "5 days = 5 days");
- equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 gün", "25 days = 25 days");
- equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "bir ay", "26 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "bir ay", "30 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "bir ay", "45 days = a month");
- equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 ay", "46 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 ay", "75 days = 2 months");
- equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 ay", "76 days = 3 months");
- equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "bir ay", "1 month = a month");
- equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 ay", "5 months = 5 months");
- equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 ay", "344 days = 11 months");
- equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "bir yıl", "345 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "bir yıl", "547 days = a year");
- equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 yıl", "548 days = 2 years");
- equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "bir yıl", "1 year = a year");
- equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 yıl", "5 years = 5 years");
-});
-
-test("suffix", 2, function() {
- moment.lang('tr');
- equal(moment(30000).from(0), "birkaç saniye sonra", "prefix");
- equal(moment(0).from(30000), "birkaç saniye önce", "suffix");
-});
-
-
-test("now from now", 1, function() {
- moment.lang('tr');
- equal(moment().fromNow(), "birkaç saniye önce", "now from now should display as in the past");
-});
-
-
-test("fromNow", 2, function() {
- moment.lang('tr');
- equal(moment().add({s:30}).fromNow(), "birkaç saniye sonra", "in a few seconds");
- equal(moment().add({d:5}).fromNow(), "5 gün sonra", "in 5 days");
-});
-
-
-test("calendar day", 6, function() {
- moment.lang('tr');
-
- var a = moment().hours(2).minutes(0).seconds(0);
-
- equal(moment(a).calendar(), "bugün saat 02:00", "today at the same time");
- equal(moment(a).add({ m: 25 }).calendar(), "bugün saat 02:25", "Now plus 25 min");
- equal(moment(a).add({ h: 1 }).calendar(), "bugün saat 03:00", "Now plus 1 hour");
- equal(moment(a).add({ d: 1 }).calendar(), "yarın saat 02:00", "tomorrow at the same time");
- equal(moment(a).subtract({ h: 1 }).calendar(), "bugün saat 01:00", "Now minus 1 hour");
- equal(moment(a).subtract({ d: 1 }).calendar(), "dün 02:00", "yesterday at the same time");
-});
-
-test("calendar next week", 15, function() {
- moment.lang('tr');
-
- var i;
- var m;
-
- for (i = 2; i < 7; i++) {
- m = moment().add({ d: i });
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days current time");
- m.hours(0).minutes(0).seconds(0).milliseconds(0);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days end of day");
- }
-});
-
-test("calendar last week", 15, function() {
- moment.lang('tr');
-
- for (i = 2; i < 7; i++) {
- m = moment().subtract({ d: i });
- 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);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days beginning of day");
- m.hours(23).minutes(59).seconds(59).milliseconds(999);
- equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days end of day");
- }
-});
-
-test("calendar all else", 4, function() {
- moment.lang('tr');
- var weeksAgo = moment().subtract({ w: 1 });
- var weeksFromNow = moment().add({ w: 1 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "1 week ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 1 week");
-
- weeksAgo = moment().subtract({ w: 2 });
- weeksFromNow = moment().add({ w: 2 });
-
- equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
- equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
-});
-})();
\ No newline at end of file
+++ /dev/null
-/*
- * QUnit - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2011 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
- */
-
-(function(window) {
-
-var defined = {
- setTimeout: typeof window.setTimeout !== "undefined",
- sessionStorage: (function() {
- try {
- return !!sessionStorage.getItem;
- } catch(e){
- return false;
- }
- })()
-};
-
-var testId = 0;
-
-var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
- this.name = name;
- this.testName = testName;
- this.expected = expected;
- this.testEnvironmentArg = testEnvironmentArg;
- this.async = async;
- this.callback = callback;
- this.assertions = [];
-};
-Test.prototype = {
- init: function() {
- var tests = id("qunit-tests");
- if (tests) {
- var b = document.createElement("strong");
- b.innerHTML = "Running " + this.name;
- var li = document.createElement("li");
- li.appendChild( b );
- li.className = "running";
- li.id = this.id = "test-output" + testId++;
- tests.appendChild( li );
- }
- },
- setup: function() {
- if (this.module != config.previousModule) {
- if ( config.previousModule ) {
- QUnit.moduleDone( {
- name: config.previousModule,
- failed: config.moduleStats.bad,
- passed: config.moduleStats.all - config.moduleStats.bad,
- total: config.moduleStats.all
- } );
- }
- config.previousModule = this.module;
- config.moduleStats = { all: 0, bad: 0 };
- QUnit.moduleStart( {
- name: this.module
- } );
- }
-
- config.current = this;
- this.testEnvironment = extend({
- setup: function() {},
- teardown: function() {}
- }, this.moduleTestEnvironment);
- if (this.testEnvironmentArg) {
- extend(this.testEnvironment, this.testEnvironmentArg);
- }
-
- QUnit.testStart( {
- name: this.testName
- } );
-
- // allow utility functions to access the current test environment
- // TODO why??
- QUnit.current_testEnvironment = this.testEnvironment;
-
- try {
- if ( !config.pollution ) {
- saveGlobal();
- }
-
- this.testEnvironment.setup.call(this.testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
- }
- },
- run: function() {
- if ( this.async ) {
- QUnit.stop();
- }
-
- if ( config.notrycatch ) {
- this.callback.call(this.testEnvironment);
- return;
- }
- try {
- this.callback.call(this.testEnvironment);
- } catch(e) {
- fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
- QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
- // else next test will carry the responsibility
- saveGlobal();
-
- // Restart the tests if they're blocking
- if ( config.blocking ) {
- start();
- }
- }
- },
- teardown: function() {
- try {
- checkPollution();
- this.testEnvironment.teardown.call(this.testEnvironment);
- } catch(e) {
- QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
- }
- },
- finish: function() {
- if ( this.expected && this.expected != this.assertions.length ) {
- QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
- }
-
- var good = 0, bad = 0,
- tests = id("qunit-tests");
-
- config.stats.all += this.assertions.length;
- config.moduleStats.all += this.assertions.length;
-
- if ( tests ) {
- var ol = document.createElement("ol");
-
- for ( var i = 0; i < this.assertions.length; i++ ) {
- var assertion = this.assertions[i];
-
- var li = document.createElement("li");
- li.className = assertion.result ? "pass" : "fail";
- li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
- ol.appendChild( li );
-
- if ( assertion.result ) {
- good++;
- } else {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
-
- // store result when possible
- QUnit.config.reorder && defined.sessionStorage && sessionStorage.setItem("qunit-" + this.testName, bad);
-
- if (bad == 0) {
- ol.style.display = "none";
- }
-
- var b = document.createElement("strong");
- b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
-
- addEvent(b, "click", function() {
- var next = b.nextSibling, display = next.style.display;
- next.style.display = display === "none" ? "block" : "none";
- });
-
- addEvent(b, "dblclick", function(e) {
- var target = e && e.target ? e.target : window.event.srcElement;
- if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
- target = target.parentNode;
- }
- if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
- window.location.search = "?" + encodeURIComponent(getText([target]).replace(/\(.+\)$/, "").replace(/(^\s*|\s*$)/g, ""));
- }
- });
-
- var li = id(this.id);
- li.className = bad ? "fail" : "pass";
- li.removeChild( li.firstChild );
- li.appendChild( b );
- li.appendChild( ol );
-
- } else {
- for ( var i = 0; i < this.assertions.length; i++ ) {
- if ( !this.assertions[i].result ) {
- bad++;
- config.stats.bad++;
- config.moduleStats.bad++;
- }
- }
- }
-
- try {
- QUnit.reset();
- } catch(e) {
- fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
- }
-
- QUnit.testDone( {
- name: this.testName,
- failed: bad,
- passed: this.assertions.length - bad,
- total: this.assertions.length
- } );
- },
-
- queue: function() {
- var test = this;
- synchronize(function() {
- test.init();
- });
- function run() {
- // each of these can by async
- synchronize(function() {
- test.setup();
- });
- synchronize(function() {
- test.run();
- });
- synchronize(function() {
- test.teardown();
- });
- synchronize(function() {
- test.finish();
- });
- }
- // defer when previous test run passed, if storage is available
- var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.testName);
- if (bad) {
- run();
- } else {
- synchronize(run);
- };
- }
-
-};
-
-var QUnit = {
-
- // call on start of module test to prepend name to all tests
- module: function(name, testEnvironment) {
- config.currentModule = name;
- config.currentModuleTestEnviroment = testEnvironment;
- },
-
- asyncTest: function(testName, expected, callback) {
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = 0;
- }
-
- QUnit.test(testName, expected, callback, true);
- },
-
- test: function(testName, expected, callback, async) {
- var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
-
- if ( arguments.length === 2 ) {
- callback = expected;
- expected = null;
- }
- // is 2nd argument a testEnvironment?
- if ( expected && typeof expected === 'object') {
- testEnvironmentArg = expected;
- expected = null;
- }
-
- if ( config.currentModule ) {
- name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
- }
-
- if ( !validTest(config.currentModule + ": " + testName) ) {
- return;
- }
-
- var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
- test.module = config.currentModule;
- test.moduleTestEnvironment = config.currentModuleTestEnviroment;
- test.queue();
- },
-
- /**
- * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
- */
- expect: function(asserts) {
- config.current.expected = asserts;
- },
-
- /**
- * Asserts true.
- * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
- */
- ok: function(a, msg) {
- a = !!a;
- var details = {
- result: a,
- message: msg
- };
- msg = escapeHtml(msg);
- QUnit.log(details);
- config.current.assertions.push({
- result: a,
- message: msg
- });
- },
-
- /**
- * Checks that the first two arguments are equal, with an optional message.
- * Prints out both actual and expected values.
- *
- * Prefered to ok( actual == expected, message )
- *
- * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
- *
- * @param Object actual
- * @param Object expected
- * @param String message (optional)
- */
- equal: function(actual, expected, message) {
- QUnit.push(expected == actual, actual, expected, message);
- },
-
- notEqual: function(actual, expected, message) {
- QUnit.push(expected != actual, actual, expected, message);
- },
-
- deepEqual: function(actual, expected, message) {
- QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
- },
-
- notDeepEqual: function(actual, expected, message) {
- QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
- },
-
- strictEqual: function(actual, expected, message) {
- QUnit.push(expected === actual, actual, expected, message);
- },
-
- notStrictEqual: function(actual, expected, message) {
- QUnit.push(expected !== actual, actual, expected, message);
- },
-
- raises: function(block, expected, message) {
- var actual, ok = false;
-
- if (typeof expected === 'string') {
- message = expected;
- expected = null;
- }
-
- try {
- block();
- } catch (e) {
- actual = e;
- }
-
- if (actual) {
- // we don't want to validate thrown error
- if (!expected) {
- ok = true;
- // expected is a regexp
- } else if (QUnit.objectType(expected) === "regexp") {
- ok = expected.test(actual);
- // expected is a constructor
- } else if (actual instanceof expected) {
- ok = true;
- // expected is a validation function which returns true is validation passed
- } else if (expected.call({}, actual) === true) {
- ok = true;
- }
- }
-
- QUnit.ok(ok, message);
- },
-
- start: function() {
- config.semaphore--;
- if (config.semaphore > 0) {
- // don't start until equal number of stop-calls
- return;
- }
- if (config.semaphore < 0) {
- // ignore if start is called more often then stop
- config.semaphore = 0;
- }
- // A slight delay, to avoid any current callbacks
- if ( defined.setTimeout ) {
- window.setTimeout(function() {
- if ( config.timeout ) {
- clearTimeout(config.timeout);
- }
-
- config.blocking = false;
- process();
- }, 13);
- } else {
- config.blocking = false;
- process();
- }
- },
-
- stop: function(timeout) {
- config.semaphore++;
- config.blocking = true;
-
- if ( timeout && defined.setTimeout ) {
- clearTimeout(config.timeout);
- config.timeout = window.setTimeout(function() {
- QUnit.ok( false, "Test timed out" );
- QUnit.start();
- }, timeout);
- }
- }
-
-};
-
-// Backwards compatibility, deprecated
-QUnit.equals = QUnit.equal;
-QUnit.same = QUnit.deepEqual;
-
-// Maintain internal state
-var config = {
- // The queue of tests to run
- queue: [],
-
- // block until document ready
- blocking: true,
-
- // by default, run previously failed tests first
- // very useful in combination with "Hide passed tests" checked
- reorder: true
-};
-
-// Load paramaters
-(function() {
- var location = window.location || { search: "", protocol: "file:" },
- GETParams = location.search.slice(1).split('&');
-
- for ( var i = 0; i < GETParams.length; i++ ) {
- GETParams[i] = decodeURIComponent( GETParams[i] );
- if ( GETParams[i] === "noglobals" ) {
- GETParams.splice( i, 1 );
- i--;
- config.noglobals = true;
- } else if ( GETParams[i] === "notrycatch" ) {
- GETParams.splice( i, 1 );
- i--;
- config.notrycatch = true;
- } else if ( GETParams[i].search('=') > -1 ) {
- GETParams.splice( i, 1 );
- i--;
- }
- }
-
- // restrict modules/tests by get parameters
- config.filters = GETParams;
-
- // Figure out if we're running the tests from a server or not
- QUnit.isLocal = !!(location.protocol === 'file:');
-})();
-
-// Expose the API as global variables, unless an 'exports'
-// object exists, in that case we assume we're in CommonJS
-if ( typeof exports === "undefined" || typeof require === "undefined" ) {
- extend(window, QUnit);
- window.QUnit = QUnit;
-} else {
- extend(exports, QUnit);
- exports.QUnit = QUnit;
-}
-
-// define these after exposing globals to keep them in these QUnit namespace only
-extend(QUnit, {
- config: config,
-
- // Initialize the configuration options
- init: function() {
- extend(config, {
- stats: { all: 0, bad: 0 },
- moduleStats: { all: 0, bad: 0 },
- started: +new Date,
- updateRate: 1000,
- blocking: false,
- autostart: true,
- autorun: false,
- filters: [],
- queue: [],
- semaphore: 0
- });
-
- var tests = id( "qunit-tests" ),
- banner = id( "qunit-banner" ),
- result = id( "qunit-testresult" );
-
- if ( tests ) {
- tests.innerHTML = "";
- }
-
- if ( banner ) {
- banner.className = "";
- }
-
- if ( result ) {
- result.parentNode.removeChild( result );
- }
-
- if ( tests ) {
- result = document.createElement( "p" );
- result.id = "qunit-testresult";
- result.className = "result";
- tests.parentNode.insertBefore( result, tests );
- result.innerHTML = 'Running...<br/> ';
- }
- },
-
- /**
- * Resets the test setup. Useful for tests that modify the DOM.
- *
- * If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
- */
- reset: function() {
- if ( window.jQuery ) {
- jQuery( "#main, #qunit-fixture" ).html( config.fixture );
- } else {
- var main = id( 'main' ) || id( 'qunit-fixture' );
- if ( main ) {
- main.innerHTML = config.fixture;
- }
- }
- },
-
- /**
- * Trigger an event on an element.
- *
- * @example triggerEvent( document.body, "click" );
- *
- * @param DOMElement elem
- * @param String type
- */
- triggerEvent: function( elem, type, event ) {
- if ( document.createEvent ) {
- event = document.createEvent("MouseEvents");
- event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
- 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- elem.dispatchEvent( event );
-
- } else if ( elem.fireEvent ) {
- elem.fireEvent("on"+type);
- }
- },
-
- // Safe object type checking
- is: function( type, obj ) {
- return QUnit.objectType( obj ) == type;
- },
-
- objectType: function( obj ) {
- if (typeof obj === "undefined") {
- return "undefined";
-
- // consider: typeof null === object
- }
- if (obj === null) {
- return "null";
- }
-
- var type = Object.prototype.toString.call( obj )
- .match(/^\[object\s(.*)\]$/)[1] || '';
-
- switch (type) {
- case 'Number':
- if (isNaN(obj)) {
- return "nan";
- } else {
- return "number";
- }
- case 'String':
- case 'Boolean':
- case 'Array':
- case 'Date':
- case 'RegExp':
- case 'Function':
- return type.toLowerCase();
- }
- if (typeof obj === "object") {
- return "object";
- }
- return undefined;
- },
-
- push: function(result, actual, expected, message) {
- var details = {
- result: result,
- message: message,
- actual: actual,
- expected: expected
- };
-
- message = escapeHtml(message) || (result ? "okay" : "failed");
- message = '<span class="test-message">' + message + "</span>";
- expected = escapeHtml(QUnit.jsDump.parse(expected));
- actual = escapeHtml(QUnit.jsDump.parse(actual));
- var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
- if (actual != expected) {
- output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
- output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
- }
- if (!result) {
- var source = sourceFromStacktrace();
- if (source) {
- details.source = source;
- output += '<tr class="test-source"><th>Source: </th><td><pre>' + source +'</pre></td></tr>';
- }
- }
- output += "</table>";
-
- QUnit.log(details);
-
- config.current.assertions.push({
- result: !!result,
- message: output
- });
- },
-
- // Logging callbacks; all receive a single argument with the listed properties
- // run test/logs.html for any related changes
- begin: function() {},
- // done: { failed, passed, total, runtime }
- done: function() {},
- // log: { result, actual, expected, message }
- log: function() {},
- // testStart: { name }
- testStart: function() {},
- // testDone: { name, failed, passed, total }
- testDone: function() {},
- // moduleStart: { name }
- moduleStart: function() {},
- // moduleDone: { name, failed, passed, total }
- moduleDone: function() {}
-});
-
-if ( typeof document === "undefined" || document.readyState === "complete" ) {
- config.autorun = true;
-}
-
-addEvent(window, "load", function() {
- QUnit.begin({});
-
- // Initialize the config, saving the execution queue
- var oldconfig = extend({}, config);
- QUnit.init();
- extend(config, oldconfig);
-
- config.blocking = false;
-
- var userAgent = id("qunit-userAgent");
- if ( userAgent ) {
- userAgent.innerHTML = navigator.userAgent;
- }
- var banner = id("qunit-header");
- if ( banner ) {
- var paramsIndex = location.href.lastIndexOf(location.search);
- if ( paramsIndex > -1 ) {
- var mainPageLocation = location.href.slice(0, paramsIndex);
- if ( mainPageLocation == location.href ) {
- banner.innerHTML = '<a href=""> ' + banner.innerHTML + '</a> ';
- } else {
- var testName = decodeURIComponent(location.search.slice(1));
- banner.innerHTML = '<a href="' + mainPageLocation + '">' + banner.innerHTML + '</a> › <a href="">' + testName + '</a>';
- }
- }
- }
-
- var toolbar = id("qunit-testrunner-toolbar");
- if ( toolbar ) {
- var filter = document.createElement("input");
- filter.type = "checkbox";
- filter.id = "qunit-filter-pass";
- addEvent( filter, "click", function() {
- var ol = document.getElementById("qunit-tests");
- if ( filter.checked ) {
- ol.className = ol.className + " hidepass";
- } else {
- var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
- ol.className = tmp.replace(/ hidepass /, " ");
- }
- if ( defined.sessionStorage ) {
- sessionStorage.setItem("qunit-filter-passed-tests", filter.checked ? "true" : "");
- }
- });
- if ( defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
- filter.checked = true;
- var ol = document.getElementById("qunit-tests");
- ol.className = ol.className + " hidepass";
- }
- toolbar.appendChild( filter );
-
- var label = document.createElement("label");
- label.setAttribute("for", "qunit-filter-pass");
- label.innerHTML = "Hide passed tests";
- toolbar.appendChild( label );
- }
-
- var main = id('main') || id('qunit-fixture');
- if ( main ) {
- config.fixture = main.innerHTML;
- }
-
- if (config.autostart) {
- QUnit.start();
- }
-});
-
-function done() {
- config.autorun = true;
-
- // Log the last module results
- if ( config.currentModule ) {
- QUnit.moduleDone( {
- name: config.currentModule,
- failed: config.moduleStats.bad,
- passed: config.moduleStats.all - config.moduleStats.bad,
- total: config.moduleStats.all
- } );
- }
-
- var banner = id("qunit-banner"),
- tests = id("qunit-tests"),
- runtime = +new Date - config.started,
- passed = config.stats.all - config.stats.bad,
- html = [
- 'Tests completed in ',
- runtime,
- ' milliseconds.<br/>',
- '<span class="passed">',
- passed,
- '</span> tests of <span class="total">',
- config.stats.all,
- '</span> passed, <span class="failed">',
- config.stats.bad,
- '</span> failed.'
- ].join('');
-
- if ( banner ) {
- banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
- }
-
- if ( tests ) {
- id( "qunit-testresult" ).innerHTML = html;
- }
-
- QUnit.done( {
- failed: config.stats.bad,
- passed: passed,
- total: config.stats.all,
- runtime: runtime
- } );
-}
-
-function validTest( name ) {
- var i = config.filters.length,
- run = false;
-
- if ( !i ) {
- return true;
- }
-
- while ( i-- ) {
- var filter = config.filters[i],
- not = filter.charAt(0) == '!';
-
- if ( not ) {
- filter = filter.slice(1);
- }
-
- if ( name.indexOf(filter) !== -1 ) {
- return !not;
- }
-
- if ( not ) {
- run = true;
- }
- }
-
- return run;
-}
-
-// so far supports only Firefox, Chrome and Opera (buggy)
-// could be extended in the future to use something like https://github.com/csnover/TraceKit
-function sourceFromStacktrace() {
- try {
- throw new Error();
- } catch ( e ) {
- if (e.stacktrace) {
- // Opera
- return e.stacktrace.split("\n")[6];
- } else if (e.stack) {
- // Firefox, Chrome
- return e.stack.split("\n")[4];
- }
- }
-}
-
-function escapeHtml(s) {
- if (!s) {
- return "";
- }
- s = s + "";
- return s.replace(/[\&"<>\\]/g, function(s) {
- switch(s) {
- case "&": return "&";
- case "\\": return "\\\\";
- case '"': return '\"';
- case "<": return "<";
- case ">": return ">";
- default: return s;
- }
- });
-}
-
-function synchronize( callback ) {
- config.queue.push( callback );
-
- if ( config.autorun && !config.blocking ) {
- process();
- }
-}
-
-function process() {
- var start = (new Date()).getTime();
-
- while ( config.queue.length && !config.blocking ) {
- if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
- config.queue.shift()();
- } else {
- window.setTimeout( process, 13 );
- break;
- }
- }
- if (!config.blocking && !config.queue.length) {
- done();
- }
-}
-
-function saveGlobal() {
- config.pollution = [];
-
- if ( config.noglobals ) {
- for ( var key in window ) {
- config.pollution.push( key );
- }
- }
-}
-
-function checkPollution( name ) {
- var old = config.pollution;
- saveGlobal();
-
- var newGlobals = diff( old, config.pollution );
- if ( newGlobals.length > 0 ) {
- ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
- config.current.expected++;
- }
-
- var deletedGlobals = diff( config.pollution, old );
- if ( deletedGlobals.length > 0 ) {
- ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
- config.current.expected++;
- }
-}
-
-// returns a new Array with the elements that are in a but not in b
-function diff( a, b ) {
- var result = a.slice();
- for ( var i = 0; i < result.length; i++ ) {
- for ( var j = 0; j < b.length; j++ ) {
- if ( result[i] === b[j] ) {
- result.splice(i, 1);
- i--;
- break;
- }
- }
- }
- return result;
-}
-
-function fail(message, exception, callback) {
- if ( typeof console !== "undefined" && console.error && console.warn ) {
- console.error(message);
- console.error(exception);
- console.warn(callback.toString());
-
- } else if ( window.opera && opera.postError ) {
- opera.postError(message, exception, callback.toString);
- }
-}
-
-function extend(a, b) {
- for ( var prop in b ) {
- a[prop] = b[prop];
- }
-
- return a;
-}
-
-function addEvent(elem, type, fn) {
- if ( elem.addEventListener ) {
- elem.addEventListener( type, fn, false );
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, fn );
- } else {
- fn();
- }
-}
-
-function id(name) {
- return !!(typeof document !== "undefined" && document && document.getElementById) &&
- document.getElementById( name );
-}
-
-// Test for equality any JavaScript type.
-// Discussions and reference: http://philrathe.com/articles/equiv
-// Test suites: http://philrathe.com/tests/equiv
-// Author: Philippe Rathé <prathe@gmail.com>
-QUnit.equiv = function () {
-
- var innerEquiv; // the real equiv function
- var callers = []; // stack to decide between skip/abort functions
- var parents = []; // stack to avoiding loops from circular referencing
-
- // Call the o related callback with the given arguments.
- function bindCallbacks(o, callbacks, args) {
- var prop = QUnit.objectType(o);
- if (prop) {
- if (QUnit.objectType(callbacks[prop]) === "function") {
- return callbacks[prop].apply(callbacks, args);
- } else {
- return callbacks[prop]; // or undefined
- }
- }
- }
-
- var callbacks = function () {
-
- // for string, boolean, number and null
- function useStrictEquality(b, a) {
- if (b instanceof a.constructor || a instanceof b.constructor) {
- // to catch short annotaion VS 'new' annotation of a declaration
- // e.g. var i = 1;
- // var j = new Number(1);
- return a == b;
- } else {
- return a === b;
- }
- }
-
- return {
- "string": useStrictEquality,
- "boolean": useStrictEquality,
- "number": useStrictEquality,
- "null": useStrictEquality,
- "undefined": useStrictEquality,
-
- "nan": function (b) {
- return isNaN(b);
- },
-
- "date": function (b, a) {
- return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf();
- },
-
- "regexp": function (b, a) {
- return QUnit.objectType(b) === "regexp" &&
- a.source === b.source && // the regex itself
- a.global === b.global && // and its modifers (gmi) ...
- a.ignoreCase === b.ignoreCase &&
- a.multiline === b.multiline;
- },
-
- // - skip when the property is a method of an instance (OOP)
- // - abort otherwise,
- // initial === would have catch identical references anyway
- "function": function () {
- var caller = callers[callers.length - 1];
- return caller !== Object &&
- typeof caller !== "undefined";
- },
-
- "array": function (b, a) {
- var i, j, loop;
- var len;
-
- // b could be an object literal here
- if ( ! (QUnit.objectType(b) === "array")) {
- return false;
- }
-
- len = a.length;
- if (len !== b.length) { // safe and faster
- return false;
- }
-
- //track reference to avoid circular references
- parents.push(a);
- for (i = 0; i < len; i++) {
- loop = false;
- for(j=0;j<parents.length;j++){
- if(parents[j] === a[i]){
- loop = true;//dont rewalk array
- }
- }
- if (!loop && ! innerEquiv(a[i], b[i])) {
- parents.pop();
- return false;
- }
- }
- parents.pop();
- return true;
- },
-
- "object": function (b, a) {
- var i, j, loop;
- var eq = true; // unless we can proove it
- var aProperties = [], bProperties = []; // collection of strings
-
- // comparing constructors is more strict than using instanceof
- if ( a.constructor !== b.constructor) {
- return false;
- }
-
- // stack constructor before traversing properties
- callers.push(a.constructor);
- //track reference to avoid circular references
- parents.push(a);
-
- for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
- loop = false;
- for(j=0;j<parents.length;j++){
- if(parents[j] === a[i])
- loop = true; //don't go down the same path twice
- }
- aProperties.push(i); // collect a's properties
-
- if (!loop && ! innerEquiv(a[i], b[i])) {
- eq = false;
- break;
- }
- }
-
- callers.pop(); // unstack, we are done
- parents.pop();
-
- for (i in b) {
- bProperties.push(i); // collect b's properties
- }
-
- // Ensures identical properties name
- return eq && innerEquiv(aProperties.sort(), bProperties.sort());
- }
- };
- }();
-
- innerEquiv = function () { // can take multiple arguments
- var args = Array.prototype.slice.apply(arguments);
- if (args.length < 2) {
- return true; // end transition
- }
-
- return (function (a, b) {
- if (a === b) {
- return true; // catch the most you can
- } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || QUnit.objectType(a) !== QUnit.objectType(b)) {
- return false; // don't lose time with error prone cases
- } else {
- return bindCallbacks(a, callbacks, [b, a]);
- }
-
- // apply transition with (1..n) arguments
- })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
- };
-
- return innerEquiv;
-
-}();
-
-/**
- * jsDump
- * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
- * Date: 5/15/2008
- * @projectDescription Advanced and extensible data dumping for Javascript.
- * @version 1.0.0
- * @author Ariel Flesler
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
- */
-QUnit.jsDump = (function() {
- function quote( str ) {
- return '"' + str.toString().replace(/"/g, '\\"') + '"';
- };
- function literal( o ) {
- return o + '';
- };
- function join( pre, arr, post ) {
- var s = jsDump.separator(),
- base = jsDump.indent(),
- inner = jsDump.indent(1);
- if ( arr.join )
- arr = arr.join( ',' + s + inner );
- if ( !arr )
- return pre + post;
- return [ pre, inner + arr, base + post ].join(s);
- };
- function array( arr ) {
- var i = arr.length, ret = Array(i);
- this.up();
- while ( i-- )
- ret[i] = this.parse( arr[i] );
- this.down();
- return join( '[', ret, ']' );
- };
-
- var reName = /^function (\w+)/;
-
- var jsDump = {
- parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
- var parser = this.parsers[ type || this.typeOf(obj) ];
- type = typeof parser;
-
- return type == 'function' ? parser.call( this, obj ) :
- type == 'string' ? parser :
- this.parsers.error;
- },
- typeOf:function( obj ) {
- var type;
- if ( obj === null ) {
- type = "null";
- } else if (typeof obj === "undefined") {
- type = "undefined";
- } else if (QUnit.is("RegExp", obj)) {
- type = "regexp";
- } else if (QUnit.is("Date", obj)) {
- type = "date";
- } else if (QUnit.is("Function", obj)) {
- type = "function";
- } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
- type = "window";
- } else if (obj.nodeType === 9) {
- type = "document";
- } else if (obj.nodeType) {
- type = "node";
- } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) {
- type = "array";
- } else {
- type = typeof obj;
- }
- return type;
- },
- separator:function() {
- return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' ';
- },
- indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
- if ( !this.multiline )
- return '';
- var chr = this.indentChar;
- if ( this.HTML )
- chr = chr.replace(/\t/g,' ').replace(/ /g,' ');
- return Array( this._depth_ + (extra||0) ).join(chr);
- },
- up:function( a ) {
- this._depth_ += a || 1;
- },
- down:function( a ) {
- this._depth_ -= a || 1;
- },
- setParser:function( name, parser ) {
- this.parsers[name] = parser;
- },
- // The next 3 are exposed so you can use them
- quote:quote,
- literal:literal,
- join:join,
- //
- _depth_: 1,
- // This is the list of parsers, to modify them, use jsDump.setParser
- parsers:{
- window: '[Window]',
- document: '[Document]',
- error:'[ERROR]', //when no parser is found, shouldn't happen
- unknown: '[Unknown]',
- 'null':'null',
- 'undefined':'undefined',
- 'function':function( fn ) {
- var ret = 'function',
- name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
- if ( name )
- ret += ' ' + name;
- ret += '(';
-
- ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
- return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
- },
- array: array,
- nodelist: array,
- arguments: array,
- object:function( map ) {
- var ret = [ ];
- QUnit.jsDump.up();
- for ( var key in map )
- ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(map[key]) );
- QUnit.jsDump.down();
- return join( '{', ret, '}' );
- },
- node:function( node ) {
- var open = QUnit.jsDump.HTML ? '<' : '<',
- close = QUnit.jsDump.HTML ? '>' : '>';
-
- var tag = node.nodeName.toLowerCase(),
- ret = open + tag;
-
- for ( var a in QUnit.jsDump.DOMAttrs ) {
- var val = node[QUnit.jsDump.DOMAttrs[a]];
- if ( val )
- ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
- }
- return ret + close + open + '/' + tag + close;
- },
- functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
- var l = fn.length;
- if ( !l ) return '';
-
- var args = Array(l);
- while ( l-- )
- args[l] = String.fromCharCode(97+l);//97 is 'a'
- return ' ' + args.join(', ') + ' ';
- },
- key:quote, //object calls it internally, the key part of an item in a map
- functionCode:'[code]', //function calls it internally, it's the content of the function
- attribute:quote, //node calls it internally, it's an html attribute value
- string:quote,
- date:quote,
- regexp:literal, //regex
- number:literal,
- 'boolean':literal
- },
- DOMAttrs:{//attributes to dump from nodes, name=>realName
- id:'id',
- name:'name',
- 'class':'className'
- },
- HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
- indentChar:' ',//indentation unit
- multiline:true //if true, items in a collection, are separated by a \n, else just a space.
- };
-
- return jsDump;
-})();
-
-// from Sizzle.js
-function getText( elems ) {
- var ret = "", elem;
-
- for ( var i = 0; elems[i]; i++ ) {
- elem = elems[i];
-
- // Get the text from text nodes and CDATA nodes
- if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
- ret += elem.nodeValue;
-
- // Traverse everything else, except comment nodes
- } else if ( elem.nodeType !== 8 ) {
- ret += getText( elem.childNodes );
- }
- }
-
- return ret;
-};
-
-/*
- * Javascript Diff Algorithm
- * By John Resig (http://ejohn.org/)
- * Modified by Chu Alan "sprite"
- *
- * Released under the MIT license.
- *
- * More Info:
- * http://ejohn.org/projects/javascript-diff-algorithm/
- *
- * Usage: QUnit.diff(expected, actual)
- *
- * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
- */
-QUnit.diff = (function() {
- function diff(o, n){
- var ns = new Object();
- var os = new Object();
-
- for (var i = 0; i < n.length; i++) {
- if (ns[n[i]] == null)
- ns[n[i]] = {
- rows: new Array(),
- o: null
- };
- ns[n[i]].rows.push(i);
- }
-
- for (var i = 0; i < o.length; i++) {
- if (os[o[i]] == null)
- os[o[i]] = {
- rows: new Array(),
- n: null
- };
- os[o[i]].rows.push(i);
- }
-
- for (var i in ns) {
- if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
- n[ns[i].rows[0]] = {
- text: n[ns[i].rows[0]],
- row: os[i].rows[0]
- };
- o[os[i].rows[0]] = {
- text: o[os[i].rows[0]],
- row: ns[i].rows[0]
- };
- }
- }
-
- for (var i = 0; i < n.length - 1; i++) {
- if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
- n[i + 1] == o[n[i].row + 1]) {
- n[i + 1] = {
- text: n[i + 1],
- row: n[i].row + 1
- };
- o[n[i].row + 1] = {
- text: o[n[i].row + 1],
- row: i + 1
- };
- }
- }
-
- for (var i = n.length - 1; i > 0; i--) {
- if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
- n[i - 1] == o[n[i].row - 1]) {
- n[i - 1] = {
- text: n[i - 1],
- row: n[i].row - 1
- };
- o[n[i].row - 1] = {
- text: o[n[i].row - 1],
- row: i - 1
- };
- }
- }
-
- return {
- o: o,
- n: n
- };
- }
-
- return function(o, n){
- o = o.replace(/\s+$/, '');
- n = n.replace(/\s+$/, '');
- var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
-
- var str = "";
-
- var oSpace = o.match(/\s+/g);
- if (oSpace == null) {
- oSpace = [" "];
- }
- else {
- oSpace.push(" ");
- }
- var nSpace = n.match(/\s+/g);
- if (nSpace == null) {
- nSpace = [" "];
- }
- else {
- nSpace.push(" ");
- }
-
- if (out.n.length == 0) {
- for (var i = 0; i < out.o.length; i++) {
- str += '<del>' + out.o[i] + oSpace[i] + "</del>";
- }
- }
- else {
- if (out.n[0].text == null) {
- for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
- str += '<del>' + out.o[n] + oSpace[n] + "</del>";
- }
- }
-
- for (var i = 0; i < out.n.length; i++) {
- if (out.n[i].text == null) {
- str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
- }
- else {
- var pre = "";
-
- for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
- pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
- }
- str += " " + out.n[i].text + nSpace[i] + pre;
- }
- }
- }
-
- return str;
- };
-})();
-
-})(this);
\ No newline at end of file
+++ /dev/null
-/*
- * Snippet :: jQuery Syntax Highlighter v2.0.0
- * http://steamdev.com/snippet
- *
- * Copyright 2011, SteamDev
- * Released under the MIT license.
- * http://www.opensource.org/licenses/mit-license.php
- *
- * Date: Wed Jan 19, 2011
- */
-
-(function($) {
-
- //enables console.log() in all browsers for error messages
- window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};
-
- $.fn.snippet = function(language,settings) {
-
- if(typeof language == "object"){settings = language;}
-
- if(typeof language == "string"){
- language = language.toLowerCase();
- }
-
- var defaults = {
- style:"random",
- showNum:true,
- transparent:false,
- collapse:false,
- menu:true,
- showMsg:"Expand Code",
- hideMsg:"Collapse Code",
- clipboard:"",
- startCollapsed:true,
- startText:false,
- box:"",
- boxColor:"",
- boxFill:""
- };
-
- // array containing all style names
- var styleArr = ["acid","berries-dark","berries-light","bipolar","blacknblue","bright","contrast","darkblue","darkness","desert","dull","easter","emacs","golden","greenlcd","ide-anjuta","ide-codewarrior","ide-devcpp","ide-eclipse","ide-kdev","ide-msvcpp","kwrite","matlab","navy","nedit","neon","night","pablo","peachpuff","print","rand01","the","typical","vampire","vim","vim-dark","whatis","whitengrey","zellner"];
-
- if(settings){$.extend(defaults,settings)}
-
- return this.each(function() {
-
- // variable containing the style to be used
- var useStyle = defaults.style.toLowerCase();
- if(defaults.style == "random"){
- var randomnumber=Math.floor(Math.random()*(styleArr.length));
- useStyle = styleArr[randomnumber];
- }
-
- // variable containing the selected node
- var o = $(this);
-
- // the name of the selected node
- var node = this.nodeName.toLowerCase();
-
- // if the node is indeed a <pre> element...
- if(node == "pre"){
-
- // saves the original html as a data on the node
- if(o.data('orgHtml')==undefined || o.data('orgHtml')==null){
- var orgHtml = o.html();
- o.data('orgHtml',orgHtml);
- }
-
- // if node IS NOT an existing Snippet...
- if(!o.parent().hasClass("snippet-wrap")){
-
- // if language is NOT a string...
- if(typeof language != "string"){
- if(o.attr('class').length>0){var errclass=" class=\""+o.attr('class')+"\""}else{var errclass="";}
- if(o.attr('id').length>0){var errid=" id=\""+o.attr('id')+"\""}else{var errid="";}
- var error = "Snippet Error: You must specify a language on inital usage of Snippet. Reference <pre"+errclass+errid+">";
- console.log(error);
- return false;
- }
-
- o.addClass("sh_"+language).addClass("snippet-formatted").wrap("<div class='snippet-container' style='"+o.attr('style')+";'><div class='sh_"+useStyle+" snippet-wrap'></div></div>");
- o.removeAttr('style');
- sh_highlightDocument();
-
- // build an ordered list if showNum is true
- if(defaults.showNum){
- var newhtml = o.html();
- newhtml=newhtml.replace(/\n/g, "</li><li>");
- newhtml="<ol class='snippet-num'><li>"+newhtml+"</li></ol>";
- while(newhtml.indexOf("<li></li></ol>") != -1){
- newhtml=newhtml.replace("<li></li></ol>","</ol>");
- }
- }
- // build an unordered list if showNum is false
- else {
- var newhtml = o.html();
- newhtml=newhtml.replace(/\n/g, "</li><li>");
- newhtml="<ul class='snippet-no-num'><li>"+newhtml+"</li></ul>";
- while(newhtml.indexOf("<li></li></ul>") != -1){
- newhtml=newhtml.replace("<li></li></ul>","</ul>");
- }
- }
-
- // normalizes tab space by replacing them with 4 non-breaking spaces
- newhtml=newhtml.replace(/\t/g, " ");
-
-
- // insert highlighted code into <pre> element
- o.html(newhtml);
-
- // cleans up the highlighted html
- while(o.find("li").eq(0).html() == ""){
- o.find("li").eq(0).remove();
- }
- o.find("li").each(function(){
- if($(this).html().length<2){
- var rep = ($(this).html()).replace(/\s/g,"");
- if(rep==""){
- if($.browser.opera){
- $(this).html(" ");
- } else {
- $(this).html("<span style='display:none;'> </span>");
- }
- }
- }
- });
-
- // builds text-only view and hover menu
- var txtOnly = "<pre class='snippet-textonly sh_sourceCode' style='display:none;'>"+o.data('orgHtml')+"</pre>";
- var controls = "<div class='snippet-menu sh_sourceCode' style='display:none;'><pre>"
- +"<a class='snippet-copy' href='#'>copy</a>"
- +"<a class='snippet-text' href='#'>text</a>"
- +"<a class='snippet-window' href='#'>pop-up</a>"
- +"</pre></div>";
-
- o.parent().append(txtOnly);
- o.parent().prepend(controls);
- o.parent().hover(function(){$(this).find('.snippet-menu').fadeIn("fast");},function(){$(this).find('.snippet-menu').fadeOut("fast");});
-
- // builds clipboard
- if(defaults.clipboard!="" && defaults.clipboard!=false){
- var cpy = o.parent().find('a.snippet-copy');
- cpy.show();
- cpy.parents('.snippet-menu').show();
- var txt = o.parents('.snippet-wrap').find('.snippet-textonly').text();
- ZeroClipboard.setMoviePath(defaults.clipboard);
- var clip = new ZeroClipboard.Client();
- clip.setText(txt);
- clip.glue(cpy[0], cpy.parents('.snippet-menu')[0]);
- clip.addEventListener( 'complete', function(client, text) {
- if(text.length > 500){
- text = text.substr(0,500)+"...\n\n("+(text.length-500)+" characters not shown)";
- }
- alert("Copied text to clipboard:\n\n " + text );
- });
-
- cpy.parents('.snippet-menu').hide();
-
- } else {
- o.parent().find('a.snippet-copy').hide();
- }
-
- // click event for text-only view
- o.parent().find("a.snippet-text").click(function(){
- var org = $(this).parents('.snippet-wrap').find('.snippet-formatted');
- var txt = $(this).parents('.snippet-wrap').find('.snippet-textonly');
- org.toggle();
- txt.toggle();
-
- if(txt.is(':visible')){
- $(this).html("html");
- } else {
- $(this).html("text");
- }
- $(this).blur();
- return false;
- });
-
- // click event for popup view
- o.parent().find("a.snippet-window").click(function(){
- var txt = $(this).parents('.snippet-wrap').find('.snippet-textonly').html();
- snippetPopup(txt);
- $(this).blur();
- return false;
- });
-
- // disables menu
- if(!defaults.menu){
- o.prev('.snippet-menu').find('pre,.snippet-clipboard').hide();
- }
-
- // collapse functionality
- if(defaults.collapse){
- var styleClass = o.parent().attr('class');
- var collapseShow = "<div class='snippet-reveal "+styleClass+"'><pre class='sh_sourceCode'><a href='#' class='snippet-toggle'>"+defaults.showMsg+"</a></pre></div>";
- var collapseHide = "<div class='sh_sourceCode snippet-hide'><pre><a href='#' class='snippet-revealed snippet-toggle'>"+defaults.hideMsg+"</a></pre></div>";
-
- o.parents('.snippet-container').append(collapseShow);
- o.parent().append(collapseHide);
-
- var root = o.parents('.snippet-container');
- if(defaults.startCollapsed){
- root.find('.snippet-reveal').show();
- root.find('.snippet-wrap').eq(0).hide();
- } else {
- root.find('.snippet-reveal').hide();
- root.find('.snippet-wrap').eq(0).show();
- }
-
- root.find('a.snippet-toggle').click(function(){
- root.find('.snippet-wrap').toggle();
- return false;
- });
-
- }
-
- // makes snippet background transparent
- if(defaults.transparent){
- var styleObj = {"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"}
- o.css(styleObj);
- o.next(".snippet-textonly").css(styleObj);
- o.parents('.snippet-container').find('.snippet-reveal pre').css(styleObj);
- }
-
- // starts snippet on text-only view
- if(defaults.startText){
- o.hide();
- o.next(".snippet-textonly").show();
- o.parent().find(".snippet-text").html("html");
-
- }
-
- // boxes in specified lines of code
- if(defaults.box!=""){
- var spacer = "<span class='box-sp'> </span>";
- var boxNums = defaults.box.split(',');
- for(var i=0;i<boxNums.length;i++){
- var boxNum = boxNums[i];
- if(boxNum.indexOf('-')==-1){
- boxNum = parseFloat(boxNum)-1;
- o.find("li").eq(boxNum).addClass('box').prepend(spacer);
- } else {
- var numStart = parseFloat(boxNum.split('-')[0])-1;
- var numEnd = parseFloat(boxNum.split('-')[1])-1;
- if(numStart<numEnd){
- o.find("li").eq(numStart).addClass('box box-top').prepend(spacer);
- o.find("li").eq(numEnd).addClass('box box-bot').prepend(spacer);
- for(var x=numStart+1; x<numEnd; x++){
- o.find("li").eq(x).addClass('box box-mid').prepend(spacer);
- }
- } else if (numStart==numEnd){
- o.find("li").eq(numStart).addClass('box').prepend(spacer);
- }
- }
-
- }
-
- // sets the color of the box
- if(defaults.boxColor!=""){
- o.find("li.box").css('border-color',defaults.boxColor);
- }
-
- // sets the fill (background color) of the box
- if(defaults.boxFill!=""){
- o.find("li.box, li.box-top, li.box-mid, li.box-bot").addClass('box-bg').css('background-color',defaults.boxFill);
- }
-
- if($.browser.webkit){
- o.find(".snippet-num li.box").css('margin-left','-3.3em');
- o.find(".snippet-num li .box-sp").css('width','21px');
- }
-
- }
-
- // adds a css class to all links in the snippet so they are themed properly
- o.parents('.snippet-container').find("a").addClass("sh_url");
-
- }
- // if node IS an existing Snippet...
- else {
-
- // set new style classes, remove boxes
- o.parent().attr("class","sh_"+useStyle+" snippet-wrap");
- o.parents('.snippet-container').find('.snippet-reveal').attr("class","sh_"+useStyle+" snippet-wrap snippet-reveal");
- o.find("li.box, li.box-top, li.box-mid, li.box-bot").removeAttr('style').removeAttr('class');
- o.find("li .box-sp").remove();
-
- // set background to transparent
- if(defaults.transparent){
- var styleObj = {"background-color":"transparent","box-shadow":"none","-moz-box-shadow":"none","-webkit-box-shadow":"none"}
- o.css(styleObj);
- o.next(".snippet-textonly").css(styleObj);
- o.parents('.snippet-container').find('.snippet-hide pre').css(styleObj);
- }
- // remove transparency
- else {
- var styleObj = {"background-color":"","box-shadow":"","-moz-box-shadow":"","-webkit-box-shadow":""}
- o.css(styleObj);
- o.next(".snippet-textonly").css(styleObj);
- o.parents('.snippet-container').find('.snippet-reveal pre').css(styleObj);
- }
-
- // show numbers by switching <ul> to <ol>
- if(defaults.showNum){
-
- var list = o.find("li").eq(0).parent();
- if(list.hasClass("snippet-no-num")){
- list.wrap("<ol class='snippet-num'></ol>");
- var li = o.find("li").eq(0);
- li.unwrap();
- }
- }
- // hide numbers by switching <ol> to <ul>
- else {
- var list = o.find("li").eq(0).parent();
- if(list.hasClass("snippet-num")){
- list.wrap("<ul class='snippet-no-num'></ul>");
- var li = o.find("li").eq(0);
- li.unwrap();
- }
- }
-
- // box in specified lines
- if(defaults.box!=""){
- var spacer = "<span class='box-sp'> </span>";
- var boxNums = defaults.box.split(',');
- for(var i=0;i<boxNums.length;i++){
- var boxNum = boxNums[i];
- if(boxNum.indexOf('-')==-1){
- boxNum = parseFloat(boxNum)-1;
- o.find("li").eq(boxNum).addClass('box').prepend(spacer);
- } else {
- var numStart = parseFloat(boxNum.split('-')[0])-1;
- var numEnd = parseFloat(boxNum.split('-')[1])-1;
- if(numStart<numEnd){
- o.find("li").eq(numStart).addClass('box box-top').prepend(spacer);
- o.find("li").eq(numEnd).addClass('box box-bot').prepend(spacer);
- for(var x=numStart+1; x<numEnd; x++){
- o.find("li").eq(x).addClass('box box-mid').prepend(spacer);
- }
- } else if (numStart==numEnd){
- o.find("li").eq(numStart).addClass('box').prepend(spacer);
- }
- }
-
- }
-
- if(defaults.boxColor!=""){
- o.find("li.box").css('border-color',defaults.boxColor);
- }
-
- if(defaults.boxFill!=""){
- o.find("li.box").addClass('box-bg').css('background-color',defaults.boxFill);
- }
-
- if($.browser.webkit){
- o.find(".snippet-num li.box").css('margin-left','-3.3em');
- o.find(".snippet-num li .box-sp").css('width','21px');
- }
-
- }
-
-
-
- sh_highlightDocument();
-
- // show/hide hover menu
- if(!defaults.menu){
- o.prev('.snippet-menu').find('pre,.snippet-clipboard').hide();
- } else {
- o.prev('.snippet-menu').find('pre,.snippet-clipboard').show();
- }
-
- }
-
- } else {
- var error = "Snippet Error: Sorry, Snippet only formats '<pre>' elements. '<"+node+">' elements are currently unsupported.";
- console.log(error);
- return false;
- }
-
- });
-
- };
-
-})(jQuery);
-
-
-// snippet new window popup function
-function snippetPopup(content) {
- top.consoleRef=window.open('','myconsole',
- 'width=600,height=300'
- +',left=50,top=50'
- +',menubar=0'
- +',toolbar=0'
- +',location=0'
- +',status=0'
- +',scrollbars=1'
- +',resizable=1');
- top.consoleRef.document.writeln(
- '<html><head><title>Snippet :: Code View :: '+location.href+'</title></head>'
- +'<body bgcolor=white onLoad="self.focus()">'
- +'<pre>'+content+'</pre>'
- +'</body></html>'
- );
- top.consoleRef.document.close();
-}
-
-
-
-
-
-// ZeroClipboard
-// Simple Set Clipboard System
-// Author: Joseph Huckaby
-
-var ZeroClipboard = {
-
- version: "1.0.7",
- clients: {}, // registered upload clients on page, indexed by id
- moviePath: 'ZeroClipboard.swf', // URL to movie
- nextId: 1, // ID of next movie
-
- $: function(thingy) {
- // simple DOM lookup utility function
- if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
- if (!thingy.addClass) {
- // extend element with a few useful methods
- thingy.hide = function() { this.style.display = 'none'; };
- thingy.show = function() { this.style.display = ''; };
- thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
- thingy.removeClass = function(name) {
- var classes = this.className.split(/\s+/);
- var idx = -1;
- for (var k = 0; k < classes.length; k++) {
- if (classes[k] == name) { idx = k; k = classes.length; }
- }
- if (idx > -1) {
- classes.splice( idx, 1 );
- this.className = classes.join(' ');
- }
- return this;
- };
- thingy.hasClass = function(name) {
- return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
- };
- }
- return thingy;
- },
-
- setMoviePath: function(path) {
- // set path to ZeroClipboard.swf
- this.moviePath = path;
- },
-
- dispatch: function(id, eventName, args) {
- // receive event from flash movie, send to client
- var client = this.clients[id];
- if (client) {
- client.receiveEvent(eventName, args);
- }
- },
-
- register: function(id, client) {
- // register new client to receive events
- this.clients[id] = client;
- },
-
- getDOMObjectPosition: function(obj, stopObj) {
- // get absolute coordinates for dom element
- var info = {
- left: 0,
- top: 0,
- width: obj.width ? obj.width : obj.offsetWidth,
- height: obj.height ? obj.height : obj.offsetHeight
- };
-
- while (obj && (obj != stopObj)) {
- info.left += obj.offsetLeft;
- info.top += obj.offsetTop;
- obj = obj.offsetParent;
- }
-
- return info;
- },
-
- Client: function(elem) {
- // constructor for new simple upload client
- this.handlers = {};
-
- // unique ID
- this.id = ZeroClipboard.nextId++;
- this.movieId = 'ZeroClipboardMovie_' + this.id;
-
- // register client with singleton to receive flash events
- ZeroClipboard.register(this.id, this);
-
- // create movie
- if (elem) this.glue(elem);
- }
-};
-
-ZeroClipboard.Client.prototype = {
-
- id: 0, // unique ID for us
- ready: false, // whether movie is ready to receive events or not
- movie: null, // reference to movie object
- clipText: '', // text to copy to clipboard
- handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
- cssEffects: true, // enable CSS mouse effects on dom container
- handlers: null, // user event handlers
-
- glue: function(elem, appendElem, stylesToAdd) {
- // glue to DOM element
- // elem can be ID or actual DOM element object
- this.domElement = ZeroClipboard.$(elem);
-
- // float just above object, or zIndex 99 if dom element isn't set
- var zIndex = 99;
- if (this.domElement.style.zIndex) {
- zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
- }
-
- if (typeof(appendElem) == 'string') {
- appendElem = ZeroClipboard.$(appendElem);
- }
- else if (typeof(appendElem) == 'undefined') {
- appendElem = document.getElementsByTagName('body')[0];
- }
-
- // find X/Y position of domElement
- var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
-
- // create floating DIV above element
- this.div = document.createElement('div');
- this.div.className = "snippet-clipboard";
- var style = this.div.style;
- style.position = 'absolute';
- style.left = '' + box.left + 'px';
- style.top = '' + box.top + 'px';
- style.width = '' + box.width + 'px';
- style.height = '' + box.height + 'px';
- style.zIndex = zIndex;
-
- if (typeof(stylesToAdd) == 'object') {
- for (addedStyle in stylesToAdd) {
- style[addedStyle] = stylesToAdd[addedStyle];
- }
- }
-
- // style.backgroundColor = '#f00'; // debug
-
- appendElem.appendChild(this.div);
-
- this.div.innerHTML = this.getHTML( box.width, box.height );
- },
-
- getHTML: function(width, height) {
- // return HTML for movie
- var html = '';
- var flashvars = 'id=' + this.id +
- '&width=' + width +
- '&height=' + height;
-
- if (navigator.userAgent.match(/MSIE/)) {
- // IE gets an OBJECT tag
- var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
- html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
- }
- else {
- // all other browsers get an EMBED tag
- html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
- }
- return html;
- },
-
- hide: function() {
- // temporarily hide floater offscreen
- if (this.div) {
- this.div.style.left = '-2000px';
- }
- },
-
- show: function() {
- // show ourselves after a call to hide()
- this.reposition();
- },
-
- destroy: function() {
- // destroy control and floater
- if (this.domElement && this.div) {
- this.hide();
- this.div.innerHTML = '';
-
- var body = document.getElementsByTagName('body')[0];
- try { body.removeChild( this.div ); } catch(e) {;}
-
- this.domElement = null;
- this.div = null;
- }
- },
-
- reposition: function(elem) {
- // reposition our floating div, optionally to new container
- // warning: container CANNOT change size, only position
- if (elem) {
- this.domElement = ZeroClipboard.$(elem);
- if (!this.domElement) this.hide();
- }
-
- if (this.domElement && this.div) {
- var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
- var style = this.div.style;
- style.left = '' + box.left + 'px';
- style.top = '' + box.top + 'px';
- }
- },
-
- setText: function(newText) {
- // set text to be copied to clipboard
- this.clipText = newText;
- if (this.ready){ this.movie.setText(newText);}
- },
-
- addEventListener: function(eventName, func) {
- // add user event listener for event
- // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
- eventName = eventName.toString().toLowerCase().replace(/^on/, '');
- if (!this.handlers[eventName]){ this.handlers[eventName] = [];}
- this.handlers[eventName].push(func);
- },
-
- setHandCursor: function(enabled) {
- // enable hand cursor (true), or default arrow cursor (false)
- this.handCursorEnabled = enabled;
- if (this.ready){ this.movie.setHandCursor(enabled);}
- },
-
- setCSSEffects: function(enabled) {
- // enable or disable CSS effects on DOM container
- this.cssEffects = !!enabled;
- },
-
- receiveEvent: function(eventName, args) {
- // receive event from flash
- eventName = eventName.toString().toLowerCase().replace(/^on/, '');
-
- // special behavior for certain events
- switch (eventName) {
- case 'load':
- // movie claims it is ready, but in IE this isn't always the case...
- // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
- this.movie = document.getElementById(this.movieId);
- if (!this.movie) {
- var self = this;
- setTimeout( function() { self.receiveEvent('load', null); }, 1 );
- return;
- }
-
- // firefox on pc needs a "kick" in order to set these in certain cases
- if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
- var self = this;
- setTimeout( function() { self.receiveEvent('load', null); }, 100 );
- this.ready = true;
- return;
- }
-
- this.ready = true;
- try{
- this.movie.setText( this.clipText );
- }catch(e){}
- try{
- this.movie.setHandCursor( this.handCursorEnabled );
- }catch(e){}
- break;
-
- case 'mouseover':
- if (this.domElement && this.cssEffects) {
- this.domElement.addClass('hover');
- if (this.recoverActive){ this.domElement.addClass('active');}
- }
- break;
-
- case 'mouseout':
- if (this.domElement && this.cssEffects) {
- this.recoverActive = false;
- if (this.domElement.hasClass('active')) {
- this.domElement.removeClass('active');
- this.recoverActive = true;
- }
- this.domElement.removeClass('hover');
- }
- break;
-
- case 'mousedown':
- if (this.domElement && this.cssEffects) {
- this.domElement.addClass('active');
- }
- break;
-
- case 'mouseup':
- if (this.domElement && this.cssEffects) {
- this.domElement.removeClass('active');
- this.recoverActive = false;
- }
- break;
- } // switch eventName
-
- if (this.handlers[eventName]) {
- for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
- var func = this.handlers[eventName][idx];
-
- if (typeof(func) == 'function') {
- // actual function reference
- func(this, args);
- }
- else if ((typeof(func) == 'object') && (func.length == 2)) {
- // PHP style object + method, i.e. [myObject, 'myMethod']
- func[0][ func[1] ](this, args);
- }
- else if (typeof(func) == 'string') {
- // name of function
- window[func](this, args);
- }
- } // foreach event handler defined
- } // user defined handler for event
- }
-
-};
-
-
-/* SHJS */
-/* Copyright (C) 2007, 2008 gnombat@users.sourceforge.net */
-/* License: http://shjs.sourceforge.net/doc/gplv3.html */
-
-if(!this.sh_languages){this.sh_languages={}}var sh_requests={};function sh_isEmailAddress(a){if(/^mailto:/.test(a)){return false}return a.indexOf("@")!==-1}function sh_setHref(b,c,d){var a=d.substring(b[c-2].pos,b[c-1].pos);if(a.length>=2&&a.charAt(0)==="<"&&a.charAt(a.length-1)===">"){a=a.substr(1,a.length-2)}if(sh_isEmailAddress(a)){a="mailto:"+a}b[c-2].node.href=a}function sh_konquerorExec(b){var a=[""];a.index=b.length;a.input=b;return a}function sh_highlightString(B,o){if(/Konqueror/.test(navigator.userAgent)){if(!o.konquered){for(var F=0;F<o.length;F++){for(var H=0;H<o[F].length;H++){var G=o[F][H][0];if(G.source==="$"){G.exec=sh_konquerorExec}}}o.konquered=true}}var N=document.createElement("a");var q=document.createElement("span");var A=[];var j=0;var n=[];var C=0;var k=null;var x=function(i,a){var p=i.length;if(p===0){return}if(!a){var Q=n.length;if(Q!==0){var r=n[Q-1];if(!r[3]){a=r[1]}}}if(k!==a){if(k){A[j++]={pos:C};if(k==="sh_url"){sh_setHref(A,j,B)}}if(a){var P;if(a==="sh_url"){P=N.cloneNode(false)}else{P=q.cloneNode(false)}P.className=a;A[j++]={node:P,pos:C}}}C+=p;k=a};var t=/\r\n|\r|\n/g;t.lastIndex=0;var d=B.length;while(C<d){var v=C;var l;var w;var h=t.exec(B);if(h===null){l=d;w=d}else{l=h.index;w=t.lastIndex}var g=B.substring(v,l);var M=[];for(;;){var I=C-v;var D;var y=n.length;if(y===0){D=0}else{D=n[y-1][2]}var O=o[D];var z=O.length;var m=M[D];if(!m){m=M[D]=[]}var E=null;var u=-1;for(var K=0;K<z;K++){var f;if(K<m.length&&(m[K]===null||I<=m[K].index)){f=m[K]}else{var c=O[K][0];c.lastIndex=I;f=c.exec(g);m[K]=f}if(f!==null&&(E===null||f.index<E.index)){E=f;u=K;if(f.index===I){break}}}if(E===null){x(g.substring(I),null);break}else{if(E.index>I){x(g.substring(I,E.index),null)}var e=O[u];var J=e[1];var b;if(J instanceof Array){for(var L=0;L<J.length;L++){b=E[L+1];x(b,J[L])}}else{b=E[0];x(b,J)}switch(e[2]){case -1:break;case -2:n.pop();break;case -3:n.length=0;break;default:n.push(e);break}}}if(k){A[j++]={pos:C};if(k==="sh_url"){sh_setHref(A,j,B)}k=null}C=w}return A}function sh_getClasses(d){var a=[];var b=d.className;if(b&&b.length>0){var e=b.split(" ");for(var c=0;c<e.length;c++){if(e[c].length>0){a.push(e[c])}}}return a}function sh_addClass(c,a){var d=sh_getClasses(c);for(var b=0;b<d.length;b++){if(a.toLowerCase()===d[b].toLowerCase()){return}}d.push(a);c.className=d.join(" ")}function sh_extractTagsFromNodeList(c,a){var f=c.length;for(var d=0;d<f;d++){var e=c.item(d);switch(e.nodeType){case 1:if(e.nodeName.toLowerCase()==="br"){var b;if(/MSIE/.test(navigator.userAgent)){b="\r"}else{b="\n"}a.text.push(b);a.pos++}else{a.tags.push({node:e.cloneNode(false),pos:a.pos});sh_extractTagsFromNodeList(e.childNodes,a);a.tags.push({pos:a.pos})}break;case 3:case 4:a.text.push(e.data);a.pos+=e.length;break}}}function sh_extractTags(c,b){var a={};a.text=[];a.tags=b;a.pos=0;sh_extractTagsFromNodeList(c.childNodes,a);return a.text.join("")}function sh_mergeTags(d,f){var a=d.length;if(a===0){return f}var c=f.length;if(c===0){return d}var i=[];var e=0;var b=0;while(e<a&&b<c){var h=d[e];var g=f[b];if(h.pos<=g.pos){i.push(h);e++}else{i.push(g);if(f[b+1].pos<=h.pos){b++;i.push(f[b]);b++}else{i.push({pos:h.pos});f[b]={node:g.node.cloneNode(false),pos:h.pos}}}}while(e<a){i.push(d[e]);e++}while(b<c){i.push(f[b]);b++}return i}function sh_insertTags(k,h){var g=document;var l=document.createDocumentFragment();var e=0;var d=k.length;var b=0;var j=h.length;var c=l;while(b<j||e<d){var i;var a;if(e<d){i=k[e];a=i.pos}else{a=j}if(a<=b){if(i.node){var f=i.node;c.appendChild(f);c=f}else{c=c.parentNode}e++}else{c.appendChild(g.createTextNode(h.substring(b,a)));b=a}}return l}function sh_highlightElement(d,g){sh_addClass(d,"sh_sourceCode");var c=[];var e=sh_extractTags(d,c);var f=sh_highlightString(e,g);var b=sh_mergeTags(c,f);var a=sh_insertTags(b,e);while(d.hasChildNodes()){d.removeChild(d.firstChild)}d.appendChild(a)}function sh_getXMLHttpRequest(){if(window.ActiveXObject){return new ActiveXObject("Msxml2.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}throw"No XMLHttpRequest implementation available"}function sh_load(language,element,prefix,suffix){if(language in sh_requests){sh_requests[language].push(element);return}sh_requests[language]=[element];var request=sh_getXMLHttpRequest();var url=prefix+"sh_"+language+suffix;request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState===4){try{if(!request.status||request.status===200){eval(request.responseText);var elements=sh_requests[language];for(var i=0;i<elements.length;i++){sh_highlightElement(elements[i],sh_languages[language])}}else{throw"HTTP error: status "+request.status}}finally{request=null}}};request.send(null)}
-
-
-
-
-function sh_highlightDocument(prefix, suffix) {
- var nodeList = document.getElementsByTagName('pre');
- for (var i = 0; i < nodeList.length; i++) {
- var element = nodeList.item(i);
- var htmlClasses = element.className.toLowerCase();
- var htmlClass = htmlClasses.replace(/sh_sourcecode/g,'');
- if(htmlClass.indexOf("sh_")!=-1){htmlClass=htmlClass.match(/(\bsh_)\w+\b/g)[0];}
- if (htmlClasses.indexOf('sh_sourcecode') != -1) {continue;}
- if (htmlClass.substr(0, 3) === 'sh_') {
- var language = htmlClass.substring(3);
- if (language in sh_languages) {
- sh_highlightElement(element, sh_languages[language]);
- } else if (typeof(prefix) === 'string' && typeof(suffix) === 'string') {
- sh_load(language, element, prefix, suffix);
- } else {
- console.log('Found <pre> element with class="' + htmlClass + '", but no such language exists');
- continue;
- }
- break;
- }
- }
-}
-
-
-
-/* C language (http://shjs.sourceforge.net/lang/sh_c.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.c=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* C++ (cpp) language (http://shjs.sourceforge.net/lang/sh_cpp.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.cpp=[[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* C Sharp language (http://shjs.sourceforge.net/lang/sh_csharp.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.csharp=[[[/\b(?:using)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))(?:[FfDdMmUulL]+)?\b/g,"sh_number",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|event|new|struct|as|explicit|null|switch|base|extern|this|false|operator|throw|break|finally|out|true|fixed|override|try|case|params|typeof|catch|for|private|foreach|protected|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|continue|in|return|virtual|default|interface|sealed|volatile|delegate|internal|do|is|sizeof|while|lock|stackalloc|else|static|enum|namespace|get|partial|set|value|where|yield)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",10,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",13],[/'/g,"sh_string",14],[/\b(?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",11],[/"/g,"sh_string",12],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* CSS language (http://shjs.sourceforge.net/lang/sh_css.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.css=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/(?:\.|#)[A-Za-z0-9_]+/g,"sh_selector",-1],[/\{/g,"sh_cbracket",10,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\}/g,"sh_cbracket",-2],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/[A-Za-z0-9_-]+[ \t]*:/g,"sh_property",-1],[/[.%A-Za-z0-9_-]+/g,"sh_value",-1],[/#(?:[A-Za-z0-9_]+)/g,"sh_string",-1]]];
-
-/* Flex language (http://shjs.sourceforge.net/lang/sh_flex.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.flex=[[[/^%\{/g,"sh_preproc",1,1],[/^%[sx]/g,"sh_preproc",16,1],[/^%option/g,"sh_preproc",17,1],[/^%(?:array|pointer|[aceknopr])/g,"sh_preproc",-1],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_preproc",19,1],[/^%%/g,"sh_preproc",20,1]],[[/^%\}/g,"sh_preproc",-2],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",6]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",4]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",3,1],[/<!DOCTYPE/g,"sh_preproc",5,1],[/<!--/g,"sh_comment",6],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",7,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",7,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/$/g,null,-2],[/</g,"sh_string",12],[/"/g,"sh_string",13],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_function",-1]],[[/$/g,null,-2],[/[A-Za-z_][A-Za-z0-9_-]*/g,"sh_keyword",-1],[/"/g,"sh_string",18],[/=/g,"sh_symbol",-1]],[[/$/g,null,-2],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/"/g,"sh_string",13],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/^%%/g,"sh_preproc",21,1],[/<[A-Za-z_][A-Za-z0-9_-]*>/g,"sh_function",-1],[/"/g,"sh_string",13],[/\\./g,"sh_preproc",-1],[/\{[A-Za-z_][A-Za-z0-9_-]*\}/g,"sh_type",-1],[/\/\*/g,"sh_comment",22],[/\{/g,"sh_cbracket",23,1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1]],[[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/\*\//g,"sh_comment",-2],[/\/\*/g,"sh_comment",22]],[[/\}/g,"sh_cbracket",-2],[/\{/g,"sh_cbracket",23,1],[/\$./g,"sh_variable",-1],[/(\b(?:class|struct|typename))([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:class|const_cast|delete|dynamic_cast|explicit|false|friend|inline|mutable|namespace|new|operator|private|protected|public|reinterpret_cast|static_cast|template|this|throw|true|try|typeid|typename|using|virtual)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",2],[/\/\//g,"sh_comment",8],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(\bstruct)([ \t]+)([A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/^[ \t]*#(?:[ \t]*include)/g,"sh_preproc",11,1],[/^[ \t]*#(?:[ \t]*[A-Za-z0-9_]*)/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",14],[/'/g,"sh_string",15],[/\b(?:__asm|__cdecl|__declspec|__export|__far16|__fastcall|__fortran|__import|__pascal|__rtti|__stdcall|_asm|_cdecl|__except|_export|_far16|_fastcall|__finally|_fortran|_import|_pascal|_stdcall|__thread|__try|asm|auto|break|case|catch|cdecl|const|continue|default|do|else|enum|extern|for|goto|if|pascal|register|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]]];
-
-/* HTML language (http://shjs.sourceforge.net/lang/sh_html.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.html=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",5,1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]];
-
-/* Java language (http://shjs.sourceforge.net/lang/sh_java.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.java=[[[/\b(?:import|package)\b/g,"sh_preproc",-1],[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/(\b(?:class|interface))([ \t]+)([$A-Za-z0-9_]+)/g,["sh_keyword","sh_normal","sh_classname"],-1],[/\b(?:abstract|assert|break|case|catch|class|const|continue|default|do|else|extends|false|final|finally|for|goto|if|implements|instanceof|interface|native|new|null|private|protected|public|return|static|strictfp|super|switch|synchronized|throw|throws|true|this|transient|try|volatile|while)\b/g,"sh_keyword",-1],[/\b(?:int|byte|boolean|char|long|float|double|short|void)\b/g,"sh_type",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1],[/([A-Za-z](?:[^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]|[_])*)((?:<.*>)?)(\s+(?=[*&]*[A-Za-z][^`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\s]*\s*[`~!@#$%&*()_=+{}|;:",<.>\/?'\\[\]\^\-\[\]]+))/g,["sh_usertype","sh_usertype","sh_normal"],-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* Javascript language (http://shjs.sourceforge.net/lang/sh_javascript.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.javascript=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* Javascript DOM language (http://shjs.sourceforge.net/lang/sh_javascript_dom.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.javascript_dom=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/\b(?:applicationCache|closed|Components|content|controllers|crypto|defaultStatus|dialogArguments|directories|document|frameElement|frames|fullScreen|globalStorage|history|innerHeight|innerWidth|length|location|locationbar|menubar|name|navigator|opener|outerHeight|outerWidth|pageXOffset|pageYOffset|parent|personalbar|pkcs11|returnValue|screen|availTop|availLeft|availHeight|availWidth|colorDepth|height|left|pixelDepth|top|width|screenX|screenY|scrollbars|scrollMaxX|scrollMaxY|scrollX|scrollY|self|sessionStorage|sidebar|status|statusbar|toolbar|top|window)\b/g,"sh_predef_var",-1],[/\b(?:alert|addEventListener|atob|back|blur|btoa|captureEvents|clearInterval|clearTimeout|close|confirm|dump|escape|find|focus|forward|getAttention|getComputedStyle|getSelection|home|moveBy|moveTo|open|openDialog|postMessage|print|prompt|releaseEvents|removeEventListener|resizeBy|resizeTo|scroll|scrollBy|scrollByLines|scrollByPages|scrollTo|setInterval|setTimeout|showModalDialog|sizeToContent|stop|unescape|updateCommands|onabort|onbeforeunload|onblur|onchange|onclick|onclose|oncontextmenu|ondragdrop|onerror|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onpaint|onreset|onresize|onscroll|onselect|onsubmit|onunload)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];
-
-/* perl language (http://shjs.sourceforge.net/lang/sh_perl.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.perl=[[[/\b(?:import)\b/g,"sh_preproc",-1],[/(s)(\{(?:\\\}|[^}])*\}\{(?:\\\}|[^}])*\})([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\((?:\\\)|[^)])*\)\((?:\\\)|[^)])*\))([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(\[(?:\\\]|[^\]])*\]\[(?:\\\]|[^\]])*\])([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(s)(<.*><.*>)([ixsmogce]*)/g,["sh_keyword","sh_regexp","sh_keyword"],-1],[/(q(?:q?))(\{(?:\\\}|[^}])*\})/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\((?:\\\)|[^)])*\))/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(\[(?:\\\]|[^\]])*\])/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))(<.*>)/g,["sh_keyword","sh_string"],-1],[/(q(?:q?))([^A-Za-z0-9 \t])(.*\2)/g,["sh_keyword","sh_string","sh_string"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2.*\2)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_keyword"],-1],[/(s)([^A-Za-z0-9 \t])(.*\2[ \t]*)([^A-Za-z0-9 \t])(.*\4)([ixsmogce]*(?=[ \t]*(?:\)|;)))/g,["sh_keyword","sh_regexp","sh_regexp","sh_regexp","sh_regexp","sh_keyword"],-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/(?:m|qr)(?=\{)/g,"sh_keyword",2],[/(?:m|qr)(?=#)/g,"sh_keyword",4],[/(?:m|qr)(?=\|)/g,"sh_keyword",6],[/(?:m|qr)(?=@)/g,"sh_keyword",8],[/(?:m|qr)(?=<)/g,"sh_keyword",10],[/(?:m|qr)(?=\[)/g,"sh_keyword",12],[/(?:m|qr)(?=\\)/g,"sh_keyword",14],[/(?:m|qr)(?=\/)/g,"sh_keyword",16],[/"/g,"sh_string",18],[/'/g,"sh_string",19],[/</g,"sh_string",20],[/\/[^\n]*\//g,"sh_string",-1],[/\b(?:chomp|chop|chr|crypt|hex|i|index|lc|lcfirst|length|oct|ord|pack|q|qq|reverse|rindex|sprintf|substr|tr|uc|ucfirst|m|s|g|qw|abs|atan2|cos|exp|hex|int|log|oct|rand|sin|sqrt|srand|my|local|our|delete|each|exists|keys|values|pack|read|syscall|sysread|syswrite|unpack|vec|undef|unless|return|length|grep|sort|caller|continue|dump|eval|exit|goto|last|next|redo|sub|wantarray|pop|push|shift|splice|unshift|split|switch|join|defined|foreach|last|chop|chomp|bless|dbmclose|dbmopen|ref|tie|tied|untie|while|next|map|eq|die|cmp|lc|uc|and|do|if|else|elsif|for|use|require|package|import|chdir|chmod|chown|chroot|fcntl|glob|ioctl|link|lstat|mkdir|open|opendir|readlink|rename|rmdir|stat|symlink|umask|unlink|utime|binmode|close|closedir|dbmclose|dbmopen|die|eof|fileno|flock|format|getc|print|printf|read|readdir|rewinddir|seek|seekdir|select|syscall|sysread|sysseek|syswrite|tell|telldir|truncate|warn|write|alarm|exec|fork|getpgrp|getppid|getpriority|kill|pipe|qx|setpgrp|setpriority|sleep|system|times|x|wait|waitpid)\b/g,"sh_keyword",-1],[/^\=(?:head1|head2|item)/g,"sh_comment",21],[/(?:\$[#]?|@|%)[\/A-Za-z0-9_]+/g,"sh_variable",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\{/g,"sh_regexp",3]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\{|\\\}|\}/g,"sh_regexp",-3]],[[/#/g,"sh_regexp",5]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\#|#/g,"sh_regexp",-3]],[[/\|/g,"sh_regexp",7]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\||\|/g,"sh_regexp",-3]],[[/@/g,"sh_regexp",9]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\@|@/g,"sh_regexp",-3]],[[/</g,"sh_regexp",11]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\<|\\>|>/g,"sh_regexp",-3]],[[/\[/g,"sh_regexp",13]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\]|\]/g,"sh_regexp",-3]],[[/\\/g,"sh_regexp",15]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\\|\\/g,"sh_regexp",-3]],[[/\//g,"sh_regexp",17]],[[/[ \t]+#.*/g,"sh_comment",-1],[/\$(?:[A-Za-z0-9_]+|\{[A-Za-z0-9_]+\})/g,"sh_variable",-1],[/\\\/|\//g,"sh_regexp",-3]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/\=cut/g,"sh_comment",-2]]];
-
-/* PHP language (http://shjs.sourceforge.net/lang/sh_php.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.php=[[[/\b(?:include|include_once|require|require_once)\b/g,"sh_preproc",-1],[/\/\//g,"sh_comment",1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",2],[/'/g,"sh_string",3],[/\b(?:and|or|xor|__FILE__|exception|php_user_filter|__LINE__|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|each|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|isset|list|new|old_function|print|return|static|switch|unset|use|var|while|__FUNCTION__|__CLASS__|__METHOD__)\b/g,"sh_keyword",-1],[/\/\/\//g,"sh_comment",4],[/\/\//g,"sh_comment",1],[/\/\*\*/g,"sh_comment",9],[/\/\*/g,"sh_comment",10],[/(?:\$[#]?|@|%)[A-Za-z0-9_]+/g,"sh_variable",-1],[/<\?php|~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",7]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",5,1],[/<!DOCTYPE/g,"sh_preproc",6,1],[/<!--/g,"sh_comment",7],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",8,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",8,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]];
-
-/* python language (http://shjs.sourceforge.net/lang/sh_python.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.python=[[[/\b(?:import|from)\b/g,"sh_preproc",-1],[/#/g,"sh_comment",1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/\b(?:and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|global|if|in|is|lambda|not|or|pass|print|raise|return|try|while)\b/g,"sh_keyword",-1],[/^(?:[\s]*'{3})/g,"sh_comment",2],[/^(?:[\s]*\"{3})/g,"sh_comment",3],[/^(?:[\s]*'(?:[^\\']|\\.)*'[\s]*|[\s]*\"(?:[^\\\"]|\\.)*\"[\s]*)$/g,"sh_comment",-1],[/(?:[\s]*'{3})/g,"sh_string",4],[/(?:[\s]*\"{3})/g,"sh_string",5],[/"/g,"sh_string",6],[/'/g,"sh_string",7],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\||\{|\}/g,"sh_symbol",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2]],[[/(?:'{3})/g,"sh_comment",-2]],[[/(?:\"{3})/g,"sh_comment",-2]],[[/(?:'{3})/g,"sh_string",-2]],[[/(?:\"{3})/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]]];
-
-/* ruby language (http://shjs.sourceforge.net/lang/sh_ruby.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.ruby=[[[/\b(?:require)\b/g,"sh_preproc",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/</g,"sh_string",3],[/\/[^\n]*\//g,"sh_regexp",-1],[/(%r)(\{(?:\\\}|#\{[A-Za-z0-9]+\}|[^}])*\})/g,["sh_symbol","sh_regexp"],-1],[/\b(?:alias|begin|BEGIN|break|case|defined|do|else|elsif|end|END|ensure|for|if|in|include|loop|next|raise|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|false|nil|self|true|__FILE__|__LINE__|and|not|or|def|class|module|catch|fail|load|throw)\b/g,"sh_keyword",-1],[/(?:^\=begin)/g,"sh_comment",4],[/(?:\$[#]?|@@|@)(?:[A-Za-z0-9_]+|'|\"|\/)/g,"sh_type",-1],[/[A-Za-z0-9]+(?:\?|!)/g,"sh_normal",-1],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/(#)(\{)/g,["sh_symbol","sh_cbracket"],-1],[/#/g,"sh_comment",5],[/\{|\}/g,"sh_cbracket",-1]],[[/$/g,null,-2],[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/$/g,null,-2],[/\\(?:\\|')/g,null,-1],[/'/g,"sh_string",-2]],[[/$/g,null,-2],[/>/g,"sh_string",-2]],[[/^(?:\=end)/g,"sh_comment",-2]],[[/$/g,null,-2]]];
-
-/* sql language (http://shjs.sourceforge.net/lang/sh_sql.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.sql=[[[/\b(?:VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\b/gi,"sh_type",-1],[/\b(?:ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT|BETWEEN|BINARY|BOTH|BY|BOOLEAN|CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE|DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT|ENCLOSED|ESCAPED|EXISTS|EXPLAIN|FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM|GROUP|GRANT|HAVING|IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF|JOIN|KEYS|KILL|KEY|LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE|MODIFY|NATURAL|NOT|NULL|NEXTVAL|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON|PROCEDURE|PROCEDURAL|PRIMARY|READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT|SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET|TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED|UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW|WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\b/gi,"sh_keyword",-1],[/"/g,"sh_string",1],[/'/g,"sh_string",2],[/`/g,"sh_string",3],[/#/g,"sh_comment",4],[/\/\/\//g,"sh_comment",5],[/\/\//g,"sh_comment",4],[/\/\*\*/g,"sh_comment",11],[/\/\*/g,"sh_comment",12],[/--/g,"sh_comment",4],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/`/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/$/g,null,-2]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",9]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",7]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",6,1],[/<!DOCTYPE/g,"sh_preproc",8,1],[/<!--/g,"sh_comment",9],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",10,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",10,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]]];
-
-/* URL language (http://shjs.sourceforge.net/lang/sh_url.min.js) */
-if(!this.sh_languages){this.sh_languages={};}
-sh_languages['url']=[[{'regex':/(?:<?)[A-Za-z0-9_\.\/\-_]+@[A-Za-z0-9_\.\/\-_]+(?:>?)/g,'style':'sh_url'},{'regex':/(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_]+(?:>?)/g,'style':'sh_url'}]];
-
-/* XML language (http://shjs.sourceforge.net/lang/sh_xml.min.js) */
-if(!this.sh_languages){this.sh_languages={}}sh_languages.xml=[[[/<\?xml/g,"sh_preproc",1,1],[/<!DOCTYPE/g,"sh_preproc",3,1],[/<!--/g,"sh_comment",4],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",5,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",4]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",2]]];
\ No newline at end of file
+++ /dev/null
-(function() {
-
-/**************************************************
- Node
- *************************************************/
-
-var moment;
-if (typeof window === 'undefined') {
- moment = require('../../moment');
- module = QUnit.module;
-} else {
- moment = window.moment;
-}
-
-/**************************************************
- Tests
- *************************************************/
-
-
-module("create");
-
-
-test("array", 8, function() {
- ok(moment([2010]).native() instanceof Date, "[2010]");
- ok(moment([2010, 1]).native() instanceof Date, "[2010, 1]");
- ok(moment([2010, 1, 12]).native() instanceof Date, "[2010, 1, 12]");
- ok(moment([2010, 1, 12, 1]).native() instanceof Date, "[2010, 1, 12, 1]");
- ok(moment([2010, 1, 12, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1]");
- ok(moment([2010, 1, 12, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1]");
- ok(moment([2010, 1, 12, 1, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1, 1]");
- deepEqual(moment(new Date(2010, 1, 14, 15, 25, 50, 125)), moment([2010, 1, 14, 15, 25, 50, 125]), "constructing with array === constructing with new Date()");
-});
-
-
-test("number", 2, function() {
- ok(moment(1000).native() instanceof Date, "1000");
- ok((moment(1000).valueOf() === 1000), "testing valueOf");
-});
-
-
-test("date", 1, function() {
- ok(moment(new Date()).native() instanceof Date, "new Date()");
-});
-
-test("moment", 2, function() {
- ok(moment(moment()).native() instanceof Date, "moment(moment())");
- ok(moment(moment(moment())).native() instanceof Date, "moment(moment(moment()))");
-});
-
-test("undefined", 1, function() {
- ok(moment().native() instanceof Date, "undefined");
-});
-
-
-test("string without format", 2, function() {
- ok(moment("Aug 9, 1995").native() instanceof Date, "Aug 9, 1995");
- ok(moment("Mon, 25 Dec 1995 13:30:00 GMT").native() instanceof Date, "Mon, 25 Dec 1995 13:30:00 GMT");
-});
-
-test("string without format - json", 4, function() {
- equal(moment("Date(1325132654000)").valueOf(), 1325132654000, "Date(1325132654000)");
- equal(moment("/Date(1325132654000)/").valueOf(), 1325132654000, "/Date(1325132654000)/");
- equal(moment("/Date(1325132654000+0700)/").valueOf(), 1325132654000, "/Date(1325132654000+0700)/");
- equal(moment("/Date(1325132654000-0700)/").valueOf(), 1325132654000, "/Date(1325132654000-0700)/");
-});
-
-test("string with format", 23, function() {
- moment.lang('en');
- var a = [
- ['MM-DD-YYYY', '12-02-1999'],
- ['DD-MM-YYYY', '12-02-1999'],
- ['DD/MM/YYYY', '12/02/1999'],
- ['DD_MM_YYYY', '12_02_1999'],
- ['DD:MM:YYYY', '12:02:1999'],
- ['D-M-YY', '2-2-99'],
- ['YY', '99'],
- ['DDD-YYYY', '300-1999'],
- ['DD-MM-YYYY h:m:s', '12-02-1999 2:45:10'],
- ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 am'],
- ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 pm'],
- ['h:mm a', '12:00 pm'],
- ['h:mm a', '12:30 pm'],
- ['h:mm a', '12:00 am'],
- ['h:mm a', '12:30 am'],
- ['HH:mm', '12:00'],
- ['YYYY-MM-DDTHH:mm:ss', '2011-11-11T11:11:11'],
- ['MM-DD-YYYY \\M', '12-02-1999 M'],
- ['ddd MMM DD HH:mm:ss YYYY', 'Tue Apr 07 22:52:51 2009'],
- ['HH:mm:ss', '12:00:00'],
- ['HH:mm:ss', '12:30:00'],
- ['HH:mm:ss', '00:00:00'],
- ['HH:mm:ss', '00:30:00']
- ],
- i;
- for (i = 0; i < a.length; i++) {
- equal(moment(a[i][1], a[i][0]).format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
- }
-});
-
-test("string with format (timezone)", 8, function() {
- equal(moment('5 -0700', 'H ZZ').native().getUTCHours(), 12, 'parse hours "5 -0700" ---> "H ZZ"');
- equal(moment('5 -07:00', 'H Z').native().getUTCHours(), 12, 'parse hours "5 -07:00" ---> "H Z"');
- equal(moment('5 -0730', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 -0730" ---> "H ZZ"');
- equal(moment('5 -07:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 -07:30" ---> "H Z"');
- equal(moment('5 +0100', 'H ZZ').native().getUTCHours(), 4, 'parse hours "5 +0100" ---> "H ZZ"');
- equal(moment('5 +01:00', 'H Z').native().getUTCHours(), 4, 'parse hours "5 +01:00" ---> "H Z"');
- equal(moment('5 +0130', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 +0130" ---> "H ZZ"');
- equal(moment('5 +01:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 +01:30" ---> "H Z"');
-});
-
-test("string with format (timezone offset)", 3, function() {
- var a = new Date(Date.UTC(2011, 0, 1, 1));
- var b = moment('2011 1 1 0 -01:00', 'YYYY MM DD HH Z');
- equal(a.getHours(), b.hours(), 'date created with utc == parsed string with timezone offset');
- equal(+a, +b, 'date created with utc == parsed string with timezone offset');
- var c = moment('2011 2 1 10 -05:00', 'YYYY MM DD HH Z');
- var d = moment('2011 2 1 8 -07:00', 'YYYY MM DD HH Z');
- equal(c.hours(), d.hours(), '10 am central time == 8 am pacific time');
-});
-
-test("string with array of formats", 3, function() {
- equal(moment('13-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '02 13 1999', 'switching month and day');
- equal(moment('02-13-1999', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year last');
- equal(moment('1999-02-13', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year first');
-});
-
-test("string with format - years", 2, function() {
- equal(moment('71', 'YY').format('YYYY'), '1971', '71 > 1971');
- equal(moment('69', 'YY').format('YYYY'), '2069', '69 > 2069');
-});
-
-test("implicit cloning", 2, function() {
- var momentA = moment([2011, 10, 10]);
- var momentB = moment(momentA);
- momentA.month(5);
- equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
- equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
-});
-
-test("explicit cloning", 2, function() {
- var momentA = moment([2011, 10, 10]);
- var momentB = momentA.clone();
- momentA.month(5);
- equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
- equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
-});
-
-module("add and subtract");
-
-
-test("add and subtract short", 12, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add({ms:50}).milliseconds(), 550, 'Add milliseconds');
- equal(a.add({s:1}).seconds(), 9, 'Add seconds');
- equal(a.add({m:1}).minutes(), 8, 'Add minutes');
- equal(a.add({h:1}).hours(), 7, 'Add hours');
- equal(a.add({d:1}).date(), 13, 'Add date');
- equal(a.add({w:1}).date(), 20, 'Add week');
- equal(a.add({M:1}).month(), 10, 'Add month');
- equal(a.add({y:1}).year(), 2012, 'Add year');
-
- var b = moment([2010, 0, 31]).add({M:1});
- var c = moment([2010, 1, 28]).subtract({M:1});
-
- equal(b.month(), 1, 'add month, jan 31st to feb 28th');
- equal(b.date(), 28, 'add month, jan 31st to feb 28th');
- equal(c.month(), 0, 'subtract month, feb 28th to jan 28th');
- equal(c.date(), 28, 'subtract month, feb 28th to jan 28th');
-});
-
-test("add and subtract long", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add({milliseconds:50}).milliseconds(), 550, 'Add milliseconds');
- equal(a.add({seconds:1}).seconds(), 9, 'Add seconds');
- equal(a.add({minutes:1}).minutes(), 8, 'Add minutes');
- equal(a.add({hours:1}).hours(), 7, 'Add hours');
- equal(a.add({days:1}).date(), 13, 'Add date');
- equal(a.add({weeks:1}).date(), 20, 'Add week');
- equal(a.add({months:1}).month(), 10, 'Add month');
- equal(a.add({years:1}).year(), 2012, 'Add year');
-});
-
-test("add and subtract string short", 9, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- var b = a.clone();
-
- equal(a.add('milliseconds', 50).milliseconds(), 550, 'Add milliseconds');
- equal(a.add('seconds', 1).seconds(), 9, 'Add seconds');
- equal(a.add('minutes', 1).minutes(), 8, 'Add minutes');
- equal(a.add('hours', 1).hours(), 7, 'Add hours');
- equal(a.add('days', 1).date(), 13, 'Add date');
- equal(a.add('weeks', 1).date(), 20, 'Add week');
- equal(a.add('months', 1).month(), 10, 'Add month');
- equal(a.add('years', 1).year(), 2012, 'Add year');
- equal(b.add('days', '01').date(), 13, 'Add date');
-});
-
-test("add and subtract string short", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(500);
-
- equal(a.add('ms', 50).milliseconds(), 550, 'Add milliseconds');
- equal(a.add('s', 1).seconds(), 9, 'Add seconds');
- equal(a.add('m', 1).minutes(), 8, 'Add minutes');
- equal(a.add('h', 1).hours(), 7, 'Add hours');
- equal(a.add('d', 1).date(), 13, 'Add date');
- equal(a.add('w', 1).date(), 20, 'Add week');
- equal(a.add('M', 1).month(), 10, 'Add month');
- equal(a.add('y', 1).year(), 2012, 'Add year');
-});
-
-test("adding across DST", 3, function(){
- var a = moment(new Date(2011, 2, 12, 5, 0, 0));
- var b = moment(new Date(2011, 2, 12, 5, 0, 0));
- var c = moment(new Date(2011, 2, 12, 5, 0, 0));
- var d = moment(new Date(2011, 2, 12, 5, 0, 0));
- a.add('days', 1);
- b.add('hours', 24);
- c.add('months', 1);
- equal(a.hours(), 5, 'adding days over DST difference should result in the same hour');
- if (b.isDST() && !d.isDST()) {
- equal(b.hours(), 6, 'adding hours over DST difference should result in a different hour');
- } else {
- equal(b.hours(), 5, 'adding hours over DST difference should result in a same hour if the timezone does not have daylight savings time');
- }
- equal(c.hours(), 5, 'adding months over DST difference should result in the same hour');
-});
-
-module("diff");
-
-
-test("diff", 5, function() {
- equal(moment(1000).diff(0), 1000, "1 second - 0 = 1000");
- equal(moment(1000).diff(500), 500, "1 second - .5 second = -500");
- equal(moment(0).diff(1000), -1000, "0 - 1 second = -1000");
- equal(moment(new Date(1000)).diff(1000), 0, "1 second - 1 second = 0");
- var oneHourDate = new Date(),
- nowDate = new Date();
- oneHourDate.setHours(oneHourDate.getHours() + 1);
- equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, "1 hour from now = 360000");
-});
-
-test("diff key after", 9, function() {
- equal(moment([2010]).diff([2011], 'years'), -1, "year diff");
- equal(moment([2010]).diff([2011, 6], 'years', true), -1.5, "year diff, float");
- equal(moment([2010]).diff([2010, 2], 'months'), -2, "month diff");
- equal(moment([2010]).diff([2010, 0, 7], 'weeks'), -1, "week diff");
- equal(moment([2010]).diff([2010, 0, 21], 'weeks'), -3, "week diff");
- equal(moment([2010]).diff([2010, 0, 4], 'days'), -3, "day diff");
- equal(moment([2010]).diff([2010, 0, 1, 4], 'hours'), -4, "hour diff");
- equal(moment([2010]).diff([2010, 0, 1, 0, 5], 'minutes'), -5, "minute diff");
- equal(moment([2010]).diff([2010, 0, 1, 0, 0, 6], 'seconds'), -6, "second diff");
-});
-
-test("diff key before", 9, function() {
- equal(moment([2011]).diff([2010], 'years'), 1, "year diff");
- equal(moment([2011, 6]).diff([2010], 'years', true), 1.5, "year diff, float");
- equal(moment([2010, 2]).diff([2010], 'months'), 2, "month diff");
- equal(moment([2010, 0, 4]).diff([2010], 'days'), 3, "day diff");
- equal(moment([2010, 0, 7]).diff([2010], 'weeks'), 1, "week diff");
- equal(moment([2010, 0, 21]).diff([2010], 'weeks'), 3, "week diff");
- equal(moment([2010, 0, 1, 4]).diff([2010], 'hours'), 4, "hour diff");
- equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minutes'), 5, "minute diff");
- equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'seconds'), 6, "second diff");
-});
-
-test("diff month", 1, function() {
- equal(moment([2011, 0, 31]).diff([2011, 2, 1], 'months'), -1, "month diff");
-});
-
-test("diff across DST", 2, function() {
- equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'weeks', true), 2, "diff weeks across DST");
- equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'days', true), 14, "diff weeks across DST");
-});
-
-test("diff overflow", 4, function() {
- equal(moment([2011]).diff([2010], 'months'), 12, "month diff");
- equal(moment([2010, 0, 2]).diff([2010], 'hours'), 24, "hour diff");
- equal(moment([2010, 0, 1, 2]).diff([2010], 'minutes'), 120, "minute diff");
- equal(moment([2010, 0, 1, 0, 4]).diff([2010], 'seconds'), 240, "second diff");
-});
-
-
-module("leap year");
-
-
-test("leap year", 4, function() {
- equal(moment([2010, 0, 1]).isLeapYear(), false, '2010');
- equal(moment([2100, 0, 1]).isLeapYear(), false, '2100');
- equal(moment([2008, 0, 1]).isLeapYear(), true, '2008');
- equal(moment([2000, 0, 1]).isLeapYear(), true, '2000');
-});
-
-
-module("getters and setters");
-
-
-test("getters", 8, function() {
- var a = moment([2011, 9, 12, 6, 7, 8, 9]);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
- equal(a.milliseconds(), 9, 'milliseconds');
-});
-
-test("setters", 8, function() {
- var a = moment();
- a.year(2011);
- a.month(9);
- a.date(12);
- a.hours(6);
- a.minutes(7);
- a.seconds(8);
- a.milliseconds(9);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
- equal(a.milliseconds(), 9, 'milliseconds');
-});
-
-test("setters - falsey values", 1, function() {
- var a = moment();
- // ensure minutes wasn't coincidentally 0 already
- a.minutes(1);
- a.minutes(0);
- equal(a.minutes(), 0, 'falsey value');
-});
-
-test("chaining setters", 7, function() {
- var a = moment();
- a.year(2011)
- .month(9)
- .date(12)
- .hours(6)
- .minutes(7)
- .seconds(8);
- equal(a.year(), 2011, 'year');
- equal(a.month(), 9, 'month');
- equal(a.date(), 12, 'date');
- equal(a.day(), 3, 'day');
- equal(a.hours(), 6, 'hour');
- equal(a.minutes(), 7, 'minute');
- equal(a.seconds(), 8, 'second');
-});
-
-test("day setter", 18, function() {
- var a = moment([2011, 0, 15]);
- equal(moment(a).day(0).date(), 9, 'set from saturday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from saturday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from saturday to wednesday');
-
- a = moment([2011, 0, 9]);
- equal(moment(a).day(0).date(), 9, 'set from sunday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from sunday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from sunday to wednesday');
-
- a = moment([2011, 0, 12]);
- equal(moment(a).day(0).date(), 9, 'set from wednesday to sunday');
- equal(moment(a).day(6).date(), 15, 'set from wednesday to saturday');
- equal(moment(a).day(3).date(), 12, 'set from wednesday to wednesday');
-
- equal(moment(a).day(-7).date(), 2, 'set from wednesday to last sunday');
- equal(moment(a).day(-1).date(), 8, 'set from wednesday to last saturday');
- equal(moment(a).day(-4).date(), 5, 'set from wednesday to last wednesday');
-
- equal(moment(a).day(7).date(), 16, 'set from wednesday to next sunday');
- equal(moment(a).day(13).date(), 22, 'set from wednesday to next saturday');
- equal(moment(a).day(10).date(), 19, 'set from wednesday to next wednesday');
-
- equal(moment(a).day(14).date(), 23, 'set from wednesday to second next sunday');
- equal(moment(a).day(20).date(), 29, 'set from wednesday to second next saturday');
- equal(moment(a).day(17).date(), 26, 'set from wednesday to second next wednesday');
-});
-
-
-module("format");
-
-
-test("format YY", 1, function() {
- var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
- equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format escape brackets", 5, function() {
- var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
- equal(b.format('[day]'), 'day', 'Single bracket');
- equal(b.format('[day] YY [YY]'), 'day 09 YY', 'Double bracket');
- equal(b.format('[YY'), '[09', 'Un-ended bracket');
- equal(b.format('[[YY]]'), '[YY]', 'Double nested brackets');
- equal(b.format('[[]'), '[', 'Escape open bracket');
-});
-
-test("format timezone", 4, function() {
- var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
- ok(b.format('z').match(/^[A-Z]{3,5}$/), b.format('z') + ' ---> Something like "PST"');
- ok(b.format('zz').match(/^[A-Z]{3,5}$/), b.format('zz') + ' ---> Something like "PST"');
- ok(b.format('Z').match(/^[\+\-]\d\d:\d\d$/), b.format('Z') + ' ---> Something like "+07:30"');
- ok(b.format('ZZ').match(/^[\+\-]\d{4}$/), b.format('ZZ') + ' ---> Something like "+0700"');
-});
-
-test("format multiple with zone", 1, function() {
- var b = moment('2012-10-08 -1200', ['YYYY ZZ', 'YYYY-MM-DD ZZ']);
- equals(b.format('YYYY-MM'), '2012-10', 'Parsing multiple formats should not crash with different sized formats');
-});
-
-test("isDST", 2, function() {
- var janOffset = new Date(2011, 0, 1).getTimezoneOffset(),
- julOffset = new Date(2011, 6, 1).getTimezoneOffset(),
- janIsDst = janOffset < julOffset,
- julIsDst = julOffset < janOffset,
- jan1 = moment([2011]),
- jul1 = moment([2011, 6]);
-
- if (janIsDst && julIsDst) {
- ok(0, 'January and July cannot both be in DST');
- ok(0, 'January and July cannot both be in DST');
- } else if (janIsDst) {
- ok(jan1.isDST(), 'January 1 is DST');
- ok(!jul1.isDST(), 'July 1 is not DST');
- } else if (julIsDst) {
- ok(!jan1.isDST(), 'January 1 is not DST');
- ok(jul1.isDST(), 'July 1 is DST');
- } else {
- ok(!jan1.isDST(), 'January 1 is not DST');
- ok(!jul1.isDST(), 'July 1 is not DST');
- }
-});
-
-test("zone", 3, function() {
- if (moment().zone() > 0) {
- ok(moment().format('ZZ').indexOf('-') > -1, 'When the zone() offset is greater than 0, the ISO offset should be less than zero');
- }
- if (moment().zone() < 0) {
- ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is less than 0, the ISO offset should be greater than zero');
- }
- if (moment().zone() == 0) {
- ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero');
- }
- ok(moment().zone() % 30 === 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
- equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset');
-});
-
-module("sod");
-
-test("sod", 7, function(){
- var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).sod();
- equal(m.year(), 2011, "keep the year");
- equal(m.month(), 1, "keep the month");
- equal(m.date(), 2, "keep the day");
- equal(m.hours(), 0, "strip out the hours");
- equal(m.minutes(), 0, "strip out the minutes");
- equal(m.seconds(), 0, "strip out the seconds");
- equal(m.milliseconds(), 0, "strip out the milliseconds");
-});
-
-module("eod");
-
-test("eod", 7, function(){
- var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).eod();
- equal(m.year(), 2011, "keep the year");
- equal(m.month(), 1, "keep the month");
- equal(m.date(), 2, "keep the day");
- equal(m.hours(), 23, "set the hours");
- equal(m.minutes(), 59, "set the minutes");
- equal(m.seconds(), 59, "set the seconds");
- equal(m.milliseconds(), 999, "set the seconds");
-});
-
-
-})();
-
+++ /dev/null
-extends html
-
-block styles
- link(rel="stylesheet", href="../css/style.css?_=" + builddate)
- title Moment.js Unit Test Suite
-
-block scripts
- script(src="../js/moment.js?_=" + builddate)
- script(src="../js/lang-all.min.js?_=" + builddate)
- script(src="../js/test.min.js?_=" + builddate)
-
-block content
- #test
- h1 Moment.js unit test suite
- h2#qunit-banner
- h4#qunit-userAgent
- ol#qunit-tests
+++ /dev/null
-var testrunner = require('qunit');\r
-\r
-testrunner.options.errorsOnly = true;\r
-testrunner.options.coverage = false;\r
-\r
-testrunner.run({\r
- code: "./moment.js",\r
- tests: "./site/js/test.min.js"\r
-});\r
-\r
-testrunner.run({\r
- code: "./moment.min.js",\r
- tests: "./site/js/test.min.js"\r
-});
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Català
+ *************************************************/
+
+exports["lang:ca"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('ca');
+
+ var tests = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
+
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('ca');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('ca');
+ var expected = "Gener Gen._Febrer Febr._Març Mar._Abril Abr._Maig Mai._Juny Jun._Juliol Jul._Agost Ag._Setembre Set._Octubre Oct._Novembre Nov._Desembre Des.".split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('ca');
+ var expected = "Diumenge Dg._Dilluns Dl._Dimarts Dt._Dimecres Dc._Dijous Dj._Divendres Dv._Dissabte Ds.".split("_");
+
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('ca');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segons", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minut", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minut", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuts", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuts", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hores", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hores", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hores", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un dia", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un dia", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dies", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un dia", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dies", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dies", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesos", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesos", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesos", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesos", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesos", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un any", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un any", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anys", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un any", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anys", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('ca');
+ test.equal(moment(30000).from(0), "en uns segons", "prefix");
+ test.equal(moment(0).from(30000), "fa uns segons", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('ca');
+ test.equal(moment().fromNow(), "fa uns segons", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('ca');
+ test.equal(moment().add({s:30}).fromNow(), "en uns segons", "en uns segons");
+ test.equal(moment().add({d:5}).fromNow(), "en 5 dies", "en 5 dies");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(7);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('ca');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('ca');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[el] dddd [passat a ' + ((m.hours() !== 1) ? 'les' : 'la') + '] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('ca');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Danish
+ *************************************************/
+
+exports["lang:da"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('da');
+ var tests = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('da');
+ var a = [
+ ['dddd \\den MMMM Do YYYY, h:mm:ss a', 'Søndag den Februar 14. 2010, 3:25:50 pm'],
+ ['ddd hA', 'Søn 3PM'],
+ ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. Søndag Søn'],
+ ['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', 'pm PM'],
+ ['[den] DDDo \\d\\ag på året', 'den 45. dag på året'],
+ ['L', '14/02/2010'],
+ ['LL', '14 Februar 2010'],
+ ['LLL', '14 Februar 2010 3:25 PM'],
+ ['LLLL', 'Søndag 14. Februar, 2010 3:25 PM']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('da');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('da');
+ var expected = 'Januar Jan_Februar Feb_Marts Mar_April Apr_Maj Maj_Juni Jun_Juli Jul_August Aug_September Sep_Oktober Okt_November Nov_December Dec'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('da');
+ var expected = 'Søndag Søn_Mandag Man_Tirsdag Tir_Onsdag Ons_Torsdag Tor_Fredag Fre_Lørdag Lør'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('da');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "få sekunder", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minut", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minut", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "time", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "time", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "dag", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "dag", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dage", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "dag", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dage", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dage", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "månede", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "månede", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "månede", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "månede", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "år", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "år", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "år", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('da');
+ test.equal(moment(30000).from(0), "om få sekunder", "prefix");
+ test.equal(moment(0).from(30000), "få sekunder siden", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('da');
+ test.equal(moment().fromNow(), "få sekunder siden", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('da');
+ test.equal(moment().add({s:30}).fromNow(), "om få sekunder", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "om 5 dage", "in 5 days");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ German
+ *************************************************/
+
+exports["lang:de"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('de');
+ var tests = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('de');
+ var a = [
+ ['dddd, Do MMMM YYYY, h:mm:ss a', 'Sonntag, 14. Februar 2010, 3:25:50 pm'],
+ ['ddd, hA', 'So., 3PM'],
+ ['M Mo MM MMMM MMM', '2 2. 02 Februar Febr.'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. Sonntag So.'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
+ ['L', '14.02.2010'],
+ ['LL', '14. Februar 2010'],
+ ['LLL', '14. Februar 2010 15:25 Uhr'],
+ ['LLLL', 'Sonntag, 14. Februar 2010 15:25 Uhr']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('de');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('de');
+ var expected = 'Januar Jan._Februar Febr._März Mrz._April Apr._Mai Mai_Juni Jun._Juli Jul._August Aug._September Sept._Oktober Okt._November Nov._Dezember Dez.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('de');
+ var expected = 'Sonntag So._Montag Mo._Dienstag Di._Mittwoch Mi._Donnerstag Do._Freitag Fr._Samstag Sa.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('de');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "ein paar Sekunden", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "einer Minute", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "einer Minute", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 Minuten", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 Minuten", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "einer Stunde", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "einer Stunde", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 Stunden", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 Stunden", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 Stunden", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "einem Tag", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "einem Tag", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 Tagen", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "einem Tag", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 Tagen", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 Tagen", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "einem Monat", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "einem Monat", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "einem Monat", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 Monaten", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 Monaten", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 Monaten", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "einem Monat", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 Monaten", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 Monaten", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "einem Jahr", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "einem Jahr", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 Jahren", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "einem Jahr", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 Jahren", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('de');
+ test.equal(moment(30000).from(0), "in ein paar Sekunden", "prefix");
+ test.equal(moment(0).from(30000), "vor ein paar Sekunden", "suffix");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('de');
+ test.equal(moment().add({s:30}).fromNow(), "in ein paar Sekunden", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "in 5 Tagen", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.lang('de');
+
+ var a = moment().hours(2).minutes(0).seconds(0);
+
+ test.equal(moment(a).calendar(), "Heute um 2:00 Uhr", "today at the same time");
+ test.equal(moment(a).add({ m: 25 }).calendar(), "Heute um 2:25 Uhr", "Now plus 25 min");
+ test.equal(moment(a).add({ h: 1 }).calendar(), "Heute um 3:00 Uhr", "Now plus 1 hour");
+ test.equal(moment(a).add({ d: 1 }).calendar(), "Morgen um 2:00 Uhr", "tomorrow at the same time");
+ test.equal(moment(a).subtract({ h: 1 }).calendar(), "Heute um 1:00 Uhr", "Now minus 1 hour");
+ test.equal(moment(a).subtract({ d: 1 }).calendar(), "Gestern um 2:00 Uhr", "yesterday at the same time");
+ test.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('de');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [um] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('de');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[letzten] dddd [um] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('de');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ English
+ *************************************************/
+
+exports["lang:en-gb"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('en-gb');
+ var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('en-gb');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Sun, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14th 14'],
+ ['d do dddd ddd', '0 0th Sunday Sun'],
+ ['DDD DDDo DDDD', '45 45th 045'],
+ ['w wo ww', '8 8th 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
+ ['L', '14/02/2010'],
+ ['LL', '14 February 2010'],
+ ['LLL', '14 February 2010 3:25 PM'],
+ ['LLLL', 'Sunday, 14 February 2010 3:25 PM']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('en-gb');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('en-gb');
+ var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('en-gb');
+ var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('en-gb');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('en-gb');
+ test.equal(moment(30000).from(0), "in a few seconds", "prefix");
+ test.equal(moment(0).from(30000), "a few seconds ago", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('en-gb');
+ test.equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('en-gb');
+ test.equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.lang('en-gb');
+
+ 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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('en-gb');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('en-gb');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('en-gb');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ English
+ *************************************************/
+
+exports["lang:en"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('en');
+ var tests = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('en');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Sunday, February 14th 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Sun, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2nd 02 February Feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14th 14'],
+ ['d do dddd ddd', '0 0th Sunday Sun'],
+ ['DDD DDDo DDDD', '45 45th 045'],
+ ['w wo ww', '8 8th 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
+ ['L', '02/14/2010'],
+ ['LL', 'February 14 2010'],
+ ['LLL', 'February 14 2010 3:25 PM'],
+ ['LLLL', 'Sunday, February 14 2010 3:25 PM']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('en');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('en');
+ var expected = 'January Jan_February Feb_March Mar_April Apr_May May_June Jun_July Jul_August Aug_September Sep_October Oct_November Nov_December Dec'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('en');
+ var expected = 'Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('en');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "a few seconds", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "a minute", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "a minute", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "an hour", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "an hour", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 hours", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 hours", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 hours", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "a day", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "a day", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 days", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "a day", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 days", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 days", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "a month", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "a month", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "a month", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 months", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 months", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 months", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "a month", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 months", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 months", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "a year", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "a year", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 years", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "a year", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 years", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('en');
+ test.equal(moment(30000).from(0), "in a few seconds", "prefix");
+ test.equal(moment(0).from(30000), "a few seconds ago", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('en');
+ test.equal(moment().fromNow(), "a few seconds ago", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('en');
+ test.equal(moment().add({s:30}).fromNow(), "in a few seconds", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "in 5 days", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('en');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [at] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('en');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[last] dddd [at] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('en');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Spanish
+ *************************************************/
+
+exports["lang:es"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('es');
+ var tests = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('es');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('es');
+ var expected = 'Enero Ene._Febrero Feb._Marzo Mar._Abril Abr._Mayo May._Junio Jun._Julio Jul._Agosto Ago._Septiembre Sep._Octubre Oct._Noviembre Nov._Diciembre Dic.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('es');
+ var expected = 'Domingo Dom._Lunes Lun._Martes Mar._Miércoles Mié._Jueves Jue._Viernes Vie._Sábado Sáb.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('es');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "unos segundos", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "una hora", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "una hora", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un año", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un año", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 años", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un año", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 años", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('es');
+ test.equal(moment(30000).from(0), "en unos segundos", "prefix");
+ test.equal(moment(0).from(30000), "hace unos segundos", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('es');
+ test.equal(moment().fromNow(), "hace unos segundos", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('es');
+ test.equal(moment().add({s:30}).fromNow(), "en unos segundos", "en unos segundos");
+ test.equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(7);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('es');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('es');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('es');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Euskara
+ *************************************************/
+
+exports["lang:eu"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('eu');
+ var tests = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('eu');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'igandea, otsaila 14. 2010, 3:25:50 pm'],
+ ['ddd, hA', 'ig., 3PM'],
+ ['M Mo MM MMMM MMM', '2 2. 02 otsaila ots.'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. igandea ig.'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
+ ['L', '2010-02-14'],
+ ['LL', '2010ko otsailaren 14a'],
+ ['LLL', '2010ko otsailaren 14a 15:25'],
+ ['LLLL', 'igandea, 2010ko otsailaren 14a 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('eu');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('eu');
+ var expected = 'urtarrila urt._otsaila ots._martxoa mar._apirila api._maiatza mai._ekaina eka._uztaila uzt._abuztua abu._iraila ira._urria urr._azaroa aza._abendua abe.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('eu');
+ var expected = 'igandea ig._astelehena al._asteartea ar._asteazkena az._osteguna og._ostirala ol._larunbata lr.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('eu');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundo batzuk", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minutu bat", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minutu bat", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutu", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutu", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "ordu bat", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "ordu bat", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ordu", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ordu", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ordu", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "egun bat", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "egun bat", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 egun", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "egun bat", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 egun", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 egun", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "hilabete bat", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "hilabete bat", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "hilabete bat", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 hilabete", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 hilabete", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 hilabete", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "hilabete bat", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 hilabete", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 hilabete", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "urte bat", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "urte bat", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 urte", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "urte bat", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 urte", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('eu');
+ test.equal(moment(30000).from(0), "segundo batzuk barru", "prefix");
+ test.equal(moment(0).from(30000), "duela segundo batzuk", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('eu');
+ test.equal(moment().fromNow(), "duela segundo batzuk", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('eu');
+ test.equal(moment().add({s:30}).fromNow(), "segundo batzuk barru", "in seconds");
+ test.equal(moment().add({d:5}).fromNow(), "5 egun barru", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('eu');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd LT[etan]'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('eu');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[aurreko] dddd LT[etan]'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('eu');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ French
+ *************************************************/
+
+exports["lang:fr"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('fr');
+ var tests = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('fr');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'dimanche, février 14ème 2010, 3:25:50 pm'],
+ ['ddd, hA', 'dim., 3PM'],
+ ['M Mo MM MMMM MMM', '2 2ème 02 février févr.'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14ème 14'],
+ ['d do dddd ddd', '0 0ème dimanche dim.'],
+ ['DDD DDDo DDDD', '45 45ème 045'],
+ ['w wo ww', '8 8ème 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ème day of the year'],
+ ['L', '14/02/2010'],
+ ['LL', '14 février 2010'],
+ ['LLL', '14 février 2010 15:25'],
+ ['LLLL', 'dimanche 14 février 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('fr');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2ème', '2ème');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3ème', '3ème');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4ème', '4ème');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5ème', '5ème');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6ème', '6ème');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7ème', '7ème');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8ème', '8ème');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9ème', '9ème');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10ème', '10ème');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11ème', '11ème');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12ème', '12ème');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13ème', '13ème');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14ème', '14ème');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15ème', '15ème');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16ème', '16ème');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17ème', '17ème');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18ème', '18ème');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19ème', '19ème');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20ème', '20ème');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21ème', '21ème');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22ème', '22ème');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23ème', '23ème');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24ème', '24ème');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25ème', '25ème');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26ème', '26ème');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27ème', '27ème');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28ème', '28ème');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29ème', '29ème');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30ème', '30ème');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31ème', '31ème');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('fr');
+ var expected = 'janvier janv._février févr._mars mars_avril avr._mai mai_juin juin_juillet juil._août août_septembre sept._octobre oct._novembre nov._décembre déc.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('fr');
+ var expected = 'dimanche dim._lundi lun._mardi mar._mercredi mer._jeudi jeu._vendredi ven._samedi sam.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('fr');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "quelques secondes", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "une minute", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "une minute", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutes", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutes", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "une heure", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "une heure", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 heures", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 heures", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 heures", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un jour", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un jour", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 jours", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un jour", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 jours", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 jours", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mois", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mois", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mois", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mois", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mois", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mois", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mois", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mois", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mois", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "une année", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "une année", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 années", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "une année", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 années", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('fr');
+ test.equal(moment(30000).from(0), "dans quelques secondes", "prefix");
+ test.equal(moment(0).from(30000), "il y a quelques secondes", "suffix");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('fr');
+ test.equal(moment().add({s:30}).fromNow(), "dans quelques secondes", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "dans 5 jours", "in 5 days");
+ test.done();
+ },
+
+ "same day" : function(test) {
+ test.expect(6);
+ moment.lang('fr');
+
+ var a = moment().hours(2).minutes(0).seconds(0);
+
+ test.equal(moment(a).calendar(), "Ajourd'hui à 02:00", "today at the same time");
+ test.equal(moment(a).add({ m: 25 }).calendar(), "Ajourd'hui à 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({ h: 1 }).calendar(), "Ajourd'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(), "Ajourd'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();
+ },
+
+ "same next week" : function(test) {
+ test.expect(15);
+ moment.lang('fr');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [à] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "same last week" : function(test) {
+ test.expect(15);
+ moment.lang('fr');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "same all else" : function(test) {
+ test.expect(4);
+ moment.lang('fr');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Galego
+ *************************************************/
+
+exports["lang:gl"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('gl');
+ var tests = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
+
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('es');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('gl');
+ var expected = "Xaneiro Xan._Febreiro Feb._Marzo Mar._Abril Abr._Maio Mai._Xuño Xuñ._Xullo Xul._Agosto Ago._Setembro Set._Octubro Out._Novembro Nov._Decembro Dec.".split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('gl');
+ var expected = "Domingo Dom._Luns Lun._Martes Mar._Mércores Mér._Xoves Xov._Venres Ven._Sábado Sáb.".split("_");
+
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('gl');
+ var start = moment([2007, 1, 28]);
+
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "uns segundo", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "unha hora", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "unha hora", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un día", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un día", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 días", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un día", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 días", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 días", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mes", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mes", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mes", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mes", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un ano", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un ano", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un ano", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('gl');
+ test.equal(moment(30000).from(0), "en uns segundo", "prefix");
+ test.equal(moment(0).from(30000), "fai uns segundo", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('gl');
+ test.equal(moment().fromNow(), "fai uns segundo", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('gl');
+ test.equal(moment().add({s:30}).fromNow(), "en uns segundo", "en unos segundos");
+ test.equal(moment().add({d:5}).fromNow(), "en 5 días", "en 5 días");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(7);
+ moment.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ñá a 1:00", "tomorrow minus 1 hour");
+ test.equal(moment(a).subtract({ h: 1 }).calendar(), "hoxe a 1:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({ d: 1 }).calendar(), "onte á 2:00", "yesterday at the same time");
+ test.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('gl');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('gl');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[o] dddd [pasado ' + ((m.hours() !== 1) ? 'ás' : 'a') + '] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('gl');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Italian
+ *************************************************/
+
+exports["lang:it"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('it');
+ var tests = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('it');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domenica, Febbraio 14º 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Dom, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2º 02 Febbraio Feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14º 14'],
+ ['d do dddd ddd', '0 0º Domenica Dom'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
+ ['L', '14/02/2010'],
+ ['LL', '14 Febbraio 2010'],
+ ['LLL', '14 Febbraio 2010 15:25'],
+ ['LLLL', 'Domenica, 14 Febbraio 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('it');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('it');
+ var expected = 'Gennaio Gen_Febbraio Feb_Marzo Mar_Aprile Apr_Maggio Mag_Giugno Giu_Luglio Lug_Agosto Ago_Settebre Set_Ottobre Ott_Novembre Nov_Dicembre Dic'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('it');
+ var expected = 'Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('it');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "secondi", "44 seconds = seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "un minuto", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "un minuto", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuti", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuti", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "un ora", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "un ora", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 ore", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 ore", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 ore", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "un giorno", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "un giorno", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 giorni", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "un giorno", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 giorni", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 giorni", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "un mese", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "un mese", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "un mese", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 mesi", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 mesi", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 mesi", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "un mese", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 mesi", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 mesi", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "un anno", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "un anno", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anni", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "un anno", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anni", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('it');
+ test.equal(moment(30000).from(0), "in secondi", "prefix");
+ test.equal(moment(0).from(30000), "secondi fa", "suffix");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('it');
+ test.equal(moment().add({s:30}).fromNow(), "in secondi", "in seconds");
+ test.equal(moment().add({d:5}).fromNow(), "in 5 giorni", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('it');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [alle] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('it');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[lo scorso] dddd [alle] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('it');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Korean
+ *************************************************/
+
+exports["lang:kr"] = {
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('kr');
+ var a = [
+ ['YYYY년 MMMM Do dddd a h:mm:ss', '2010년 2월 14일 일요일 오후 3:25:50'],
+ ['ddd A h', '일 오후 3'],
+ ['M Mo MM MMMM MMM', '2 2일 02 2월 2월'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14일 14'],
+ ['d do dddd ddd', '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', '2010.02.14'],
+ ['LL', '2010년 2월 14일'],
+ ['LLL', '2010년 2월 14일 오후 3시 25분'],
+ ['LLLL', '2010년 2월 14일 일요일 오후 3시 25분']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('kr');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1일', '1일');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2일', '2일');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3일', '3일');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4일', '4일');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5일', '5일');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6일', '6일');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7일', '7일');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8일', '8일');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9일', '9일');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10일', '10일');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11일', '11일');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12일', '12일');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13일', '13일');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14일', '14일');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15일', '15일');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16일', '16일');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17일', '17일');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18일', '18일');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19일', '19일');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20일', '20일');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21일', '21일');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22일', '22일');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23일', '23일');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24일', '24일');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25일', '25일');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26일', '26일');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27일', '27일');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28일', '28일');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29일', '29일');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30일', '30일');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31일', '31일');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('kr');
+ var expected = '1월 1월_2월 2월_3월 3월_4월 4월_5월 5월_6월 6월_7월 7월_8월 8월_9월 9월_10월 10월_11월 11월_12월 12월'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('kr');
+ var expected = '일요일 일_월요일 월_화요일 화_수요일 수_목요일 목_금요일 금_토요일 토'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('kr');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "몇초", "44초 = 몇초");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "일분", "45초 = 일분");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "일분", "89초 = 일분");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2분", "90초 = 2분");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44분", "44분 = 44분");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "한시간", "45분 = 한시간");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "한시간", "89분 = 한시간");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2시간", "90분 = 2시간");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5시간", "5시간 = 5시간");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21시간", "21시간 = 21시간");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "하루", "22시간 = 하루");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "하루", "35시간 = 하루");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2일", "36시간 = 2일");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "하루", "하루 = 하루");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5일", "5일 = 5일");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25일", "25일 = 25일");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "한달", "26일 = 한달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "한달", "30일 = 한달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "한달", "45일 = 한달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2달", "46일 = 2달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2달", "75일 = 2달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3달", "76일 = 3달");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "한달", "1달 = 한달");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5달", "5달 = 5달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11달", "344일 = 11달");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "일년", "345일 = 일년");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "일년", "547일 = 일년");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2년", "548일 = 2년");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "일년", "일년 = 일년");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5년", "5년 = 5년");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('kr');
+ test.equal(moment(30000).from(0), "몇초 후", "prefix");
+ test.equal(moment(0).from(30000), "몇초 전", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('kr');
+ test.equal(moment().fromNow(), "몇초 전", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('kr');
+ test.equal(moment().add({s:30}).fromNow(), "몇초 후", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "5일 후", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.lang('kr');
+
+ 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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('kr');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('kr');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('지난주 dddd LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('kr');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Norwegian bokmål
+ *************************************************/
+
+exports["lang:nb"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('nb');
+ var tests = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('nb');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'søndag, februar 14. 2010, 3:25:50 pm'],
+ ['ddd, hA', 'søn, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2. 02 februar feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. søndag søn'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
+ ['L', '2010-02-14'],
+ ['LL', '14 februar 2010'],
+ ['LLL', '14 februar 2010 15:25'],
+ ['LLLL', 'søndag 14 februar 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('nb');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('nb');
+ var expected = 'januar jan_februar feb_mars mar_april apr_mai mai_juni jun_juli jul_august aug_september sep_oktober okt_november nov_desember des'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('nb');
+ var expected = 'søndag søn_mandag man_tirsdag tir_onsdag ons_torsdag tor_fredag fre_lørdag lør'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('nb');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "noen sekunder", "44 sekunder = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "ett minutt", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "ett minutt", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dager", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dager", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dager", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en måned", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en måned", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en måned", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 måneder", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 måneder", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 måneder", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en måned", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 måneder", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 måneder", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('nb');
+ test.equal(moment(30000).from(0), "om noen sekunder", "prefix");
+ test.equal(moment(0).from(30000), "for noen sekunder siden", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('nb');
+ test.equal(moment().fromNow(), "for noen sekunder siden", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('nb');
+ test.equal(moment().add({s:30}).fromNow(), "om noen sekunder", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "om 5 dager", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.lang('nb');
+
+ var a = moment().hours(2).minutes(0).seconds(0);
+
+ test.equal(moment(a).calendar(), "I dag klokken 02:00", "today at the same time");
+ test.equal(moment(a).add({ m: 25 }).calendar(), "I dag klokken 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({ h: 1 }).calendar(), "I dag klokken 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({ d: 1 }).calendar(), "I morgen klokken 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({ h: 1 }).calendar(), "I dag klokken 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({ d: 1 }).calendar(), "I går klokken 02:00", "yesterday at the same time");
+ test.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('nb');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; i++) {
+ m = moment().add({ d: i });
+ test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days current time");
+ m.hours(0).minutes(0).seconds(0).milliseconds(0);
+ test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days beginning of day");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [klokken] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('nb');
+
+ for (i = 2; i < 7; i++) {
+ m = moment().subtract({ d: i });
+ test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days current time");
+ m.hours(0).minutes(0).seconds(0).milliseconds(0);
+ test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days beginning of day");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[Forrige] dddd [klokken] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('nb');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Dutch
+ *************************************************/
+
+exports["lang:nl"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('nl');
+ var tests = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('nl');
+ var a = [
+ ['dddd, MMMM Do YYYY, HH:mm:ss', 'zondag, februari 14de 2010, 15:25:50'],
+ ['ddd, HH', 'zo., 15'],
+ ['M Mo MM MMMM MMM', '2 2de 02 februari feb.'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14de 14'],
+ ['d do dddd ddd', '0 0de zondag zo.'],
+ ['DDD DDDo DDDD', '45 45ste 045'],
+ ['w wo ww', '8 8ste 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45ste day of the year'],
+ ['L', '14-02-2010'],
+ ['LL', '14 februari 2010'],
+ ['LLL', '14 februari 2010 15:25'],
+ ['LLLL', 'zondag 14 februari 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('nl');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2de', '2de');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3de', '3de');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4de', '4de');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5de', '5de');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6de', '6de');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7de', '7de');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8ste', '8ste');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9de', '9de');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10de', '10de');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11de', '11de');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12de', '12de');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13de', '13de');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14de', '14de');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15de', '15de');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16de', '16de');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17de', '17de');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18de', '18de');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19de', '19de');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20ste', '20ste');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21ste', '21ste');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22ste', '22ste');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23ste', '23ste');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24ste', '24ste');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25ste', '25ste');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26ste', '26ste');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27ste', '27ste');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28ste', '28ste');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29ste', '29ste');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30ste', '30ste');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31ste', '31ste');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('nl');
+ var expected = 'januari jan._februari feb._maart mar._april apr._mei mei._juni jun._juli jul._augustus aug._september sep._oktober okt._november nov._december dec.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('nl');
+ var expected = 'zondag zo._maandag ma._dinsdag di._woensdag wo._donderdag do._vrijdag vr._zaterdag za.'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('nl');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "een paar seconden", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "één minuut", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "één minuut", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuten", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuten", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "één uur", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "één uur", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 uur", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 uur", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 uur", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "één dag", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "één dag", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagen", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "één dag", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagen", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagen", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "één maand", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "één maand", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "één maand", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 maanden", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 maanden", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 maanden", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "één maand", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 maanden", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 maanden", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "één jaar", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "één jaar", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 jaar", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "één jaar", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 jaar", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('nl');
+ test.equal(moment(30000).from(0), "over een paar seconden", "prefix");
+ test.equal(moment(0).from(30000), "een paar seconden geleden", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('nl');
+ test.equal(moment().fromNow(), "een paar seconden geleden", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('nl');
+ test.equal(moment().add({s:30}).fromNow(), "over een paar seconden", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "over 5 dagen", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('nl');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [om] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('nl');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[afgelopen] dddd [om] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('nl');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Polish
+ *************************************************/
+
+exports["lang:pl"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('pl');
+ var tests = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('pl');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'niedziela, luty 14. 2010, 3:25:50 pm'],
+ ['ddd, hA', 'nie, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2. 02 luty lut'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14. 14'],
+ ['d do dddd ddd', '0 0. niedziela nie'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
+ ['L', '14-02-2010'],
+ ['LL', '14 luty 2010'],
+ ['LLL', '14 luty 2010 15:25'],
+ ['LLLL', 'niedziela, 14 luty 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('pl');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('pl');
+ var expected = 'styczeń sty_luty lut_marzec mar_kwiecień kwi_maj maj_czerwiec cze_lipiec lip_sierpień sie_wrzesień wrz_październik paź_listopad lis_grudzień gru'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('pl');
+ var expected = 'niedziela nie_poniedziałek pon_wtorek wt_środa śr_czwartek czw_piątek pt_sobota sb'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('pl');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "kilka sekund", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minuta", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minuta", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuty", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuty", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "godzina", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "godzina", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 godziny", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 godzin", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 godzin", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 dzień", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 dzień", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dni", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 dzień", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dni", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dni", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "miesiąc", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "miesiąc", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "miesiąc", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 miesiące", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 miesiące", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 miesiące", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "miesiąc", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 miesięcy", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 miesięcy", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "rok", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "rok", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 lata", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "rok", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 lat", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('pl');
+ test.equal(moment(30000).from(0), "za kilka sekund", "prefix");
+ test.equal(moment(0).from(30000), "kilka sekund temu", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('pl');
+ test.equal(moment().fromNow(), "kilka sekund temu", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(3);
+ moment.lang('pl');
+ test.equal(moment().add({s:30}).fromNow(), "za kilka sekund", "in a few seconds");
+ test.equal(moment().add({h:1}).fromNow(), "za godzinę", "in an hour");
+ test.equal(moment().add({d:5}).fromNow(), "za 5 dni", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('pl');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[W] dddd [o] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('pl');
+
+ for (i = 2; i < 7; i++) {
+ m = moment().subtract({ d: i });
+ test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days current time");
+ m.hours(0).minutes(0).seconds(0).milliseconds(0);
+ test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days beginning of day");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[W zeszły/łą] dddd [o] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('pl');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Portuguese
+ *************************************************/
+
+exports["lang:pt"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('pt');
+ var tests = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('pt');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingo, Fevereiro 14º 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Dom, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2º 02 Fevereiro Fev'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14º 14'],
+ ['d do dddd ddd', '0 0º Domingo Dom'],
+ ['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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45º day of the year'],
+ ['L', '14/02/2010'],
+ ['LL', '14 de Fevereiro de 2010'],
+ ['LLL', '14 de Fevereiro de 2010 15:25'],
+ ['LLLL', 'Domingo, 14 de Fevereiro de 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('pt');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('pt');
+ var expected = 'Janeiro Jan_Fevereiro Fev_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('pt');
+ var expected = 'Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('pt');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "segundos", "44 seconds = seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "um minuto", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "um minuto", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutos", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutos", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "uma hora", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "uma hora", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 horas", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 horas", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 horas", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "um dia", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "um dia", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dias", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "um dia", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dias", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dias", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "um mês", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "um mês", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "um mês", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 meses", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 meses", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 meses", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "um mês", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 meses", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 meses", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "um ano", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "um ano", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 anos", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "um ano", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 anos", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('pt');
+ test.equal(moment(30000).from(0), "em segundos", "prefix");
+ test.equal(moment(0).from(30000), "segundos atrás", "suffix");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('pt');
+ test.equal(moment().add({s:30}).fromNow(), "em segundos", "in seconds");
+ test.equal(moment().add({d:5}).fromNow(), "em 5 dias", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('pt');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [às] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('pt');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format((m.day() === 0 || m.day() === 6) ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('pt');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Russian
+ *************************************************/
+
+exports["lang:ru"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('ru');
+ var tests = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('ru');
+ 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', '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', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45. day of the year'],
+ ['L', '14-02-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++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('ru');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2.', '2.');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3.', '3.');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4.', '4.');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5.', '5.');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6.', '6.');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7.', '7.');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8.', '8.');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9.', '9.');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10.', '10.');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11.', '11.');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12.', '12.');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13.', '13.');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14.', '14.');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15.', '15.');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16.', '16.');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17.', '17.');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18.', '18.');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19.', '19.');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20.', '20.');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21.', '21.');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22.', '22.');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23.', '23.');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24.', '24.');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25.', '25.');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26.', '26.');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27.', '27.');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28.', '28.');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29.', '29.');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30.', '30.');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31.', '31.');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('ru');
+ var expected = 'январь янв_февраль фев_март мар_апрель апр_май май_июнь июн_июль июл_август авг_сентябрь сен_октябрь окт_ноябрь ноя_декабрь дек'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('ru');
+ var expected = 'воскресенье вск_понедельник пнд_вторник втр_среда срд_четверг чтв_пятница птн_суббота суб'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('ru');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "несколько секунд", "44 seconds = seconds");
+ 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), "2 минут", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 минут", "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), "2 часов", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 часов", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 часов", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "1 день", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "1 день", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 дней", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "1 день", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 дней", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 дней", "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:45}), true), "месяц", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 месяцев", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 месяцев", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 месяцев", "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 месяцев", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 месяцев", "344 days = 11 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:547}), true), "год", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 лет", "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 лет", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('ru');
+ test.equal(moment(30000).from(0), "через несколько секунд", "prefix");
+ test.equal(moment(0).from(30000), "несколько секунд назад", "suffix");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('ru');
+ test.equal(moment().add({s:30}).fromNow(), "через несколько секунд", "in seconds");
+ test.equal(moment().add({d:5}).fromNow(), "через 5 дней", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('ru');
+
+ var i;
+ var m;
+
+ function makeFormat(d) {
+ return d.day() === 1 ? '[Во] dddd [в] LT' : '[В] dddd [в] LT';
+ }
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format(makeFormat(m)), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('ru');
+
+ var i;
+ var m;
+
+ function makeFormat(d) {
+ switch (d.day()) {
+ case 0:
+ case 1:
+ case 3:
+ return '[В прошлый] dddd [в] LT';
+ case 6:
+ return '[В прошлое] dddd [в] LT';
+ default:
+ return '[В прошлую] dddd [в] LT';
+ }
+ }
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format(makeFormat(m)), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('ru');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ English
+ *************************************************/
+
+exports["lang:sv"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('sv');
+ var tests = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('sv');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'söndag, februari 14e 2010, 3:25:50 pm'],
+ ['ddd, hA', 'sön, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2a 02 februari feb'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14e 14'],
+ ['d do dddd ddd', '0 0e söndag sön'],
+ ['DDD DDDo DDDD', '45 45e 045'],
+ ['w wo ww', '8 8e 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45e day of the year'],
+ ['L', '2010-02-14'],
+ ['LL', '14 februari 2010'],
+ ['LLL', '14 februari 2010 15:25'],
+ ['LLLL', 'söndag 14 februari 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('sv');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2a', '2a');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3e', '3e');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4e', '4e');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5e', '5e');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6e', '6e');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7e', '7e');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8e', '8e');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9e', '9e');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10e', '10e');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11e', '11e');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12e', '12e');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13e', '13e');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14e', '14e');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15e', '15e');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16e', '16e');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17e', '17e');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18e', '18e');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19e', '19e');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20e', '20e');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21a', '21a');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22a', '22a');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23e', '23e');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24e', '24e');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25e', '25e');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26e', '26e');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27e', '27e');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28e', '28e');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29e', '29e');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30e', '30e');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31a', '31a');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('sv');
+ var expected = 'januari jan_februari feb_mars mar_april apr_maj maj_juni jun_juli jul_augusti aug_september sep_oktober okt_november nov_december dec'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('sv');
+ var expected = 'söndag sön_måndag mån_tisdag tis_onsdag ons_torsdag tor_fredag fre_lördag lör'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('sv');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "några sekunder", "44 sekunder = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "en minut", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "en minut", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minuter", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minuter", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en timme", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en timme", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timmar", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timmar", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timmar", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "en dag", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "en dag", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 dagar", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "en dag", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 dagar", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 dagar", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "en månad", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "en månad", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "en månad", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 månader", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 månader", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 månader", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "en månad", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 månader", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 månader", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "ett år", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "ett år", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 år", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "ett år", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 år", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('sv');
+ test.equal(moment(30000).from(0), "om några sekunder", "prefix");
+ test.equal(moment(0).from(30000), "för några sekunder sen", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('sv');
+ test.equal(moment().fromNow(), "för några sekunder sen", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('sv');
+ test.equal(moment().add({s:30}).fromNow(), "om några sekunder", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "om 5 dagar", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.lang('sv');
+
+ var a = moment().hours(2).minutes(0).seconds(0);
+
+ test.equal(moment(a).calendar(), "Idag klockan 02:00", "today at the same time");
+ test.equal(moment(a).add({ m: 25 }).calendar(), "Idag klockan 02:25", "Now plus 25 min");
+ test.equal(moment(a).add({ h: 1 }).calendar(), "Idag klockan 03:00", "Now plus 1 hour");
+ test.equal(moment(a).add({ d: 1 }).calendar(), "Imorgon klockan 02:00", "tomorrow at the same time");
+ test.equal(moment(a).subtract({ h: 1 }).calendar(), "Idag klockan 01:00", "Now minus 1 hour");
+ test.equal(moment(a).subtract({ d: 1 }).calendar(), "Igår klockan 02:00", "yesterday at the same time");
+ test.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('sv');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; i++) {
+ m = moment().add({ d: i });
+ test.equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days current time");
+ m.hours(0).minutes(0).seconds(0).milliseconds(0);
+ test.equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days beginning of day");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('dddd [klockan] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('sv');
+
+ for (i = 2; i < 7; i++) {
+ m = moment().subtract({ d: i });
+ test.equal(m.calendar(), m.format('[Förra] dddd [en klockan] 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 klockan] LT'), "Today - " + i + " days beginning of day");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[Förra] dddd [en klockan] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('sv');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+
+ /**************************************************
+ Turkish
+ *************************************************/
+
+exports["lang:tr"] = {
+ "parse" : function(test) {
+ test.expect(96);
+ moment.lang('tr');
+ var tests = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
+ var i;
+ function equalTest(input, mmm, i) {
+ test.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1));
+ }
+ for (i = 0; i < 12; i++) {
+ tests[i] = tests[i].split(' ');
+ equalTest(tests[i][0], 'MMM', i);
+ equalTest(tests[i][1], 'MMM', i);
+ equalTest(tests[i][0], 'MMMM', i);
+ equalTest(tests[i][1], 'MMMM', i);
+ equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i);
+ equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i);
+ equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i);
+ }
+ test.done();
+ },
+
+ "format" : function(test) {
+ test.expect(18);
+ moment.lang('tr');
+ var a = [
+ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Pazar, Şubat 14th 2010, 3:25:50 pm'],
+ ['ddd, hA', 'Paz, 3PM'],
+ ['M Mo MM MMMM MMM', '2 2nd 02 Şubat Şub'],
+ ['YYYY YY', '2010 10'],
+ ['D Do DD', '14 14th 14'],
+ ['d do dddd ddd', '0 0th Pazar Paz'],
+ ['DDD DDDo DDDD', '45 45th 045'],
+ ['w wo ww', '8 8th 08'],
+ ['h hh', '3 03'],
+ ['H HH', '15 15'],
+ ['m mm', '25 25'],
+ ['s ss', '50 50'],
+ ['a A', 'pm PM'],
+ ['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45th day of the year'],
+ ['L', '14.02.2010'],
+ ['LL', '14 Şubat 2010'],
+ ['LLL', '14 Şubat 2010 15:25'],
+ ['LLLL', 'Pazar, 14 Şubat 2010 15:25']
+ ],
+ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "format ordinal" : function(test) {
+ test.expect(31);
+ moment.lang('tr');
+ test.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
+ test.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd');
+ test.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd');
+ test.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th');
+ test.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th');
+ test.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th');
+ test.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th');
+ test.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th');
+ test.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th');
+ test.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th');
+
+ test.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th');
+ test.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th');
+ test.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th');
+ test.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th');
+ test.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th');
+ test.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th');
+ test.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th');
+ test.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th');
+ test.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th');
+ test.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th');
+
+ test.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st');
+ test.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd');
+ test.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd');
+ test.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th');
+ test.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th');
+ test.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th');
+ test.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th');
+ test.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th');
+ test.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th');
+ test.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th');
+
+ test.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st');
+ test.done();
+ },
+
+ "format month" : function(test) {
+ test.expect(12);
+ moment.lang('tr');
+ var expected = 'Ocak Oca_Şubat Şub_Mart Mar_Nisan Nis_Mayıs May_Haziran Haz_Temmuz Tem_Ağustos Ağu_Eylül Eyl_Ekim Eki_Kasım Kas_Aralık Ara'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "format week" : function(test) {
+ test.expect(7);
+ moment.lang('tr');
+ var expected = 'Pazar Paz_Pazartesi Pts_Salı Sal_Çarşamba Çar_Perşembe Per_Cuma Cum_Cumartesi Cts'.split("_");
+ var i;
+ for (i = 0; i < expected.length; i++) {
+ test.equal(moment([2011, 0, 2 + i]).format('dddd ddd'), expected[i], expected[i]);
+ }
+ test.done();
+ },
+
+ "from" : function(test) {
+ test.expect(30);
+ moment.lang('tr');
+ var start = moment([2007, 1, 28]);
+ test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "birkaç saniye", "44 seconds = a few seconds");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "bir dakika", "45 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "bir dakika", "89 seconds = a minute");
+ test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 dakika", "90 seconds = 2 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 dakika", "44 minutes = 44 minutes");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "bir saat", "45 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "bir saat", "89 minutes = an hour");
+ test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 saat", "90 minutes = 2 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 saat", "5 hours = 5 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 saat", "21 hours = 21 hours");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:22}), true), "bir gün", "22 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:35}), true), "bir gün", "35 hours = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({h:36}), true), "2 gün", "36 hours = 2 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:1}), true), "bir gün", "1 day = a day");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:5}), true), "5 gün", "5 days = 5 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:25}), true), "25 gün", "25 days = 25 days");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:26}), true), "bir ay", "26 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:30}), true), "bir ay", "30 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:45}), true), "bir ay", "45 days = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:46}), true), "2 ay", "46 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:74}), true), "2 ay", "75 days = 2 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:76}), true), "3 ay", "76 days = 3 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:1}), true), "bir ay", "1 month = a month");
+ test.equal(start.from(moment([2007, 1, 28]).add({M:5}), true), "5 ay", "5 months = 5 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:344}), true), "11 ay", "344 days = 11 months");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:345}), true), "bir yıl", "345 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:547}), true), "bir yıl", "547 days = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({d:548}), true), "2 yıl", "548 days = 2 years");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:1}), true), "bir yıl", "1 year = a year");
+ test.equal(start.from(moment([2007, 1, 28]).add({y:5}), true), "5 yıl", "5 years = 5 years");
+ test.done();
+ },
+
+ "suffix" : function(test) {
+ test.expect(2);
+ moment.lang('tr');
+ test.equal(moment(30000).from(0), "birkaç saniye sonra", "prefix");
+ test.equal(moment(0).from(30000), "birkaç saniye önce", "suffix");
+ test.done();
+ },
+
+ "now from now" : function(test) {
+ test.expect(1);
+ moment.lang('tr');
+ test.equal(moment().fromNow(), "birkaç saniye önce", "now from now should display as in the past");
+ test.done();
+ },
+
+ "fromNow" : function(test) {
+ test.expect(2);
+ moment.lang('tr');
+ test.equal(moment().add({s:30}).fromNow(), "birkaç saniye sonra", "in a few seconds");
+ test.equal(moment().add({d:5}).fromNow(), "5 gün sonra", "in 5 days");
+ test.done();
+ },
+
+ "calendar day" : function(test) {
+ test.expect(6);
+ moment.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.done();
+ },
+
+ "calendar next week" : function(test) {
+ test.expect(15);
+ moment.lang('tr');
+
+ var i;
+ var m;
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[haftaya] dddd [saat] LT'), "Today + " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar last week" : function(test) {
+ test.expect(15);
+ moment.lang('tr');
+
+ for (i = 2; i < 7; 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");
+ m.hours(23).minutes(59).seconds(59).milliseconds(999);
+ test.equal(m.calendar(), m.format('[geçen hafta] dddd [saat] LT'), "Today - " + i + " days end of day");
+ }
+ test.done();
+ },
+
+ "calendar all else" : function(test) {
+ test.expect(4);
+ moment.lang('tr');
+ var weeksAgo = moment().subtract({ w: 1 });
+ var 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 });
+
+ test.equal(weeksAgo.calendar(), weeksAgo.format('L'), "2 weeks ago");
+ test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.add_subtract = {
+ "add and subtract short" : function(test) {
+ test.expect(12);
+
+ var a = moment();
+ a.year(2011);
+ a.month(9);
+ a.date(12);
+ a.hours(6);
+ a.minutes(7);
+ a.seconds(8);
+ a.milliseconds(500);
+
+ test.equal(a.add({ms:50}).milliseconds(), 550, 'Add milliseconds');
+ test.equal(a.add({s:1}).seconds(), 9, 'Add seconds');
+ test.equal(a.add({m:1}).minutes(), 8, 'Add minutes');
+ test.equal(a.add({h:1}).hours(), 7, 'Add hours');
+ test.equal(a.add({d:1}).date(), 13, 'Add date');
+ test.equal(a.add({w:1}).date(), 20, 'Add week');
+ test.equal(a.add({M:1}).month(), 10, 'Add month');
+ test.equal(a.add({y:1}).year(), 2012, 'Add year');
+
+ var b = moment([2010, 0, 31]).add({M:1});
+ var c = moment([2010, 1, 28]).subtract({M:1});
+
+ test.equal(b.month(), 1, 'add month, jan 31st to feb 28th');
+ test.equal(b.date(), 28, 'add month, jan 31st to feb 28th');
+ test.equal(c.month(), 0, 'subtract month, feb 28th to jan 28th');
+ test.equal(c.date(), 28, 'subtract month, feb 28th to jan 28th');
+ test.done();
+ },
+
+ "add and subtract long" : function(test) {
+ test.expect(8);
+
+ var a = moment();
+ a.year(2011);
+ a.month(9);
+ a.date(12);
+ a.hours(6);
+ a.minutes(7);
+ a.seconds(8);
+ a.milliseconds(500);
+
+ test.equal(a.add({milliseconds:50}).milliseconds(), 550, 'Add milliseconds');
+ test.equal(a.add({seconds:1}).seconds(), 9, 'Add seconds');
+ test.equal(a.add({minutes:1}).minutes(), 8, 'Add minutes');
+ test.equal(a.add({hours:1}).hours(), 7, 'Add hours');
+ test.equal(a.add({days:1}).date(), 13, 'Add date');
+ test.equal(a.add({weeks:1}).date(), 20, 'Add week');
+ test.equal(a.add({months:1}).month(), 10, 'Add month');
+ test.equal(a.add({years:1}).year(), 2012, 'Add year');
+ test.done();
+ },
+
+ "add and subtract string long" : function(test) {
+ test.expect(9);
+
+ var a = moment();
+ a.year(2011);
+ a.month(9);
+ a.date(12);
+ a.hours(6);
+ a.minutes(7);
+ a.seconds(8);
+ a.milliseconds(500);
+
+ var b = a.clone();
+
+ test.equal(a.add('milliseconds', 50).milliseconds(), 550, 'Add milliseconds');
+ test.equal(a.add('seconds', 1).seconds(), 9, 'Add seconds');
+ test.equal(a.add('minutes', 1).minutes(), 8, 'Add minutes');
+ test.equal(a.add('hours', 1).hours(), 7, 'Add hours');
+ test.equal(a.add('days', 1).date(), 13, 'Add date');
+ test.equal(a.add('weeks', 1).date(), 20, 'Add week');
+ test.equal(a.add('months', 1).month(), 10, 'Add month');
+ test.equal(a.add('years', 1).year(), 2012, 'Add year');
+ test.equal(b.add('days', '01').date(), 13, 'Add date');
+ test.done();
+ },
+
+ "add and subtract string short" : function(test) {
+ test.expect(8);
+
+ var a = moment();
+ a.year(2011);
+ a.month(9);
+ a.date(12);
+ a.hours(6);
+ a.minutes(7);
+ a.seconds(8);
+ a.milliseconds(500);
+
+ test.equal(a.add('ms', 50).milliseconds(), 550, 'Add milliseconds');
+ test.equal(a.add('s', 1).seconds(), 9, 'Add seconds');
+ test.equal(a.add('m', 1).minutes(), 8, 'Add minutes');
+ test.equal(a.add('h', 1).hours(), 7, 'Add hours');
+ test.equal(a.add('d', 1).date(), 13, 'Add date');
+ test.equal(a.add('w', 1).date(), 20, 'Add week');
+ test.equal(a.add('M', 1).month(), 10, 'Add month');
+ test.equal(a.add('y', 1).year(), 2012, 'Add year');
+ test.done();
+ },
+
+ "add across DST" : function(test) {
+ test.expect(3);
+
+ var a = moment(new Date(2011, 2, 12, 5, 0, 0));
+ var b = moment(new Date(2011, 2, 12, 5, 0, 0));
+ var c = moment(new Date(2011, 2, 12, 5, 0, 0));
+ var d = moment(new Date(2011, 2, 12, 5, 0, 0));
+ a.add('days', 1);
+ b.add('hours', 24);
+ c.add('months', 1);
+ test.equal(a.hours(), 5, 'adding days over DST difference should result in the same hour');
+ if (b.isDST() && !d.isDST()) {
+ test.equal(b.hours(), 6, 'adding hours over DST difference should result in a different hour');
+ } else {
+ test.equal(b.hours(), 5, 'adding hours over DST difference should result in a same hour if the timezone does not have daylight savings time');
+ }
+ test.equal(c.hours(), 5, 'adding months over DST difference should result in the same hour');
+ test.done();
+ }
+}
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.create = {
+ "array" : function(test) {
+ test.expect(8);
+ test.ok(moment([2010]).native() instanceof Date, "[2010]");
+ test.ok(moment([2010, 1]).native() instanceof Date, "[2010, 1]");
+ test.ok(moment([2010, 1, 12]).native() instanceof Date, "[2010, 1, 12]");
+ test.ok(moment([2010, 1, 12, 1]).native() instanceof Date, "[2010, 1, 12, 1]");
+ test.ok(moment([2010, 1, 12, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1]");
+ test.ok(moment([2010, 1, 12, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1]");
+ test.ok(moment([2010, 1, 12, 1, 1, 1, 1]).native() instanceof Date, "[2010, 1, 12, 1, 1, 1, 1]");
+ test.deepEqual(moment(new Date(2010, 1, 14, 15, 25, 50, 125)), moment([2010, 1, 14, 15, 25, 50, 125]), "constructing with array === constructing with new Date()");
+ test.done();
+ },
+
+ "number" : function(test) {
+ test.expect(2);
+ test.ok(moment(1000).native() instanceof Date, "1000");
+ test.ok((moment(1000).valueOf() === 1000), "testing valueOf");
+ test.done();
+ },
+
+ "date" : function(test) {
+ test.expect(1);
+ test.ok(moment(new Date()).native() instanceof Date, "new Date()");
+ test.done();
+ },
+
+ "moment" : function(test) {
+ test.expect(2);
+ test.ok(moment(moment()).native() instanceof Date, "moment(moment())");
+ test.ok(moment(moment(moment())).native() instanceof Date, "moment(moment(moment()))");
+ test.done();
+ },
+
+ "undefined" : function(test) {
+ test.expect(1);
+ test.ok(moment().native() instanceof Date, "undefined");
+ test.done();
+ },
+
+ "string without format" : function(test) {
+ test.expect(2);
+ test.ok(moment("Aug 9, 1995").native() instanceof Date, "Aug 9, 1995");
+ test.ok(moment("Mon, 25 Dec 1995 13:30:00 GMT").native() instanceof Date, "Mon, 25 Dec 1995 13:30:00 GMT");
+ test.done();
+ },
+
+ "string without format - json" : function(test) {
+ test.expect(4);
+ test.equal(moment("Date(1325132654000)").valueOf(), 1325132654000, "Date(1325132654000)");
+ test.equal(moment("/Date(1325132654000)/").valueOf(), 1325132654000, "/Date(1325132654000)/");
+ test.equal(moment("/Date(1325132654000+0700)/").valueOf(), 1325132654000, "/Date(1325132654000+0700)/");
+ test.equal(moment("/Date(1325132654000-0700)/").valueOf(), 1325132654000, "/Date(1325132654000-0700)/");
+ test.done();
+ },
+
+ "string with format" : function(test) {
+ test.expect(23);
+ moment.lang('en');
+ var a = [
+ ['MM-DD-YYYY', '12-02-1999'],
+ ['DD-MM-YYYY', '12-02-1999'],
+ ['DD/MM/YYYY', '12/02/1999'],
+ ['DD_MM_YYYY', '12_02_1999'],
+ ['DD:MM:YYYY', '12:02:1999'],
+ ['D-M-YY', '2-2-99'],
+ ['YY', '99'],
+ ['DDD-YYYY', '300-1999'],
+ ['DD-MM-YYYY h:m:s', '12-02-1999 2:45:10'],
+ ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 am'],
+ ['DD-MM-YYYY h:m:s a', '12-02-1999 2:45:10 pm'],
+ ['h:mm a', '12:00 pm'],
+ ['h:mm a', '12:30 pm'],
+ ['h:mm a', '12:00 am'],
+ ['h:mm a', '12:30 am'],
+ ['HH:mm', '12:00'],
+ ['YYYY-MM-DDTHH:mm:ss', '2011-11-11T11:11:11'],
+ ['MM-DD-YYYY \\M', '12-02-1999 M'],
+ ['ddd MMM DD HH:mm:ss YYYY', 'Tue Apr 07 22:52:51 2009'],
+ ['HH:mm:ss', '12:00:00'],
+ ['HH:mm:ss', '12:30:00'],
+ ['HH:mm:ss', '00:00:00'],
+ ['HH:mm:ss', '00:30:00']
+ ],
+ i;
+ for (i = 0; i < a.length; i++) {
+ test.equal(moment(a[i][1], a[i][0]).format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]);
+ }
+ test.done();
+ },
+
+ "string with format (timezone)" : function(test) {
+ test.expect(8);
+ test.equal(moment('5 -0700', 'H ZZ').native().getUTCHours(), 12, 'parse hours "5 -0700" ---> "H ZZ"');
+ test.equal(moment('5 -07:00', 'H Z').native().getUTCHours(), 12, 'parse hours "5 -07:00" ---> "H Z"');
+ test.equal(moment('5 -0730', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 -0730" ---> "H ZZ"');
+ test.equal(moment('5 -07:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 -07:30" ---> "H Z"');
+ test.equal(moment('5 +0100', 'H ZZ').native().getUTCHours(), 4, 'parse hours "5 +0100" ---> "H ZZ"');
+ test.equal(moment('5 +01:00', 'H Z').native().getUTCHours(), 4, 'parse hours "5 +01:00" ---> "H Z"');
+ test.equal(moment('5 +0130', 'H ZZ').native().getUTCMinutes(), 30, 'parse hours "5 +0130" ---> "H ZZ"');
+ test.equal(moment('5 +01:30', 'H Z').native().getUTCMinutes(), 30, 'parse hours "5 +01:30" ---> "H Z"');
+ test.done();
+ },
+
+ "string with format (timezone offset)" : function(test) {
+ test.expect(3);
+ var a = new Date(Date.UTC(2011, 0, 1, 1));
+ var b = moment('2011 1 1 0 -01:00', 'YYYY MM DD HH Z');
+ test.equal(a.getHours(), b.hours(), 'date created with utc == parsed string with timezone offset');
+ test.equal(+a, +b, 'date created with utc == parsed string with timezone offset');
+ var c = moment('2011 2 1 10 -05:00', 'YYYY MM DD HH Z');
+ var d = moment('2011 2 1 8 -07:00', 'YYYY MM DD HH Z');
+ test.equal(c.hours(), d.hours(), '10 am central time == 8 am pacific time');
+ test.done();
+ },
+
+ "string with array of formats" : function(test) {
+ test.expect(3);
+ test.equal(moment('13-02-1999', ['MM-DD-YYYY', 'DD-MM-YYYY']).format('MM DD YYYY'), '02 13 1999', 'switching month and day');
+ test.equal(moment('02-13-1999', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year last');
+ test.equal(moment('1999-02-13', ['MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY']).format('MM DD YYYY'), '02 13 1999', 'year first');
+ test.done();
+ },
+
+ "string with format - years" : function(test) {
+ test.expect(2);
+ test.equal(moment('71', 'YY').format('YYYY'), '1971', '71 > 1971');
+ test.equal(moment('69', 'YY').format('YYYY'), '2069', '69 > 2069');
+ test.done();
+ },
+
+ "implicit cloning" : function(test) {
+ test.expect(2);
+ var momentA = moment([2011, 10, 10]);
+ var momentB = moment(momentA);
+ momentA.month(5);
+ test.equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
+ test.equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
+ test.done();
+ },
+
+ "explicit cloning" : function(test) {
+ test.expect(2);
+ var momentA = moment([2011, 10, 10]);
+ var momentB = momentA.clone();
+ momentA.month(5);
+ test.equal(momentB.month(), 10, "Calling moment() on a moment will create a clone");
+ test.equal(momentA.month(), 5, "Calling moment() on a moment will create a clone");
+ test.done();
+ },
+}
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.diff = {
+ "diff" : function(test) {
+ test.expect(5);
+
+ test.equal(moment(1000).diff(0), 1000, "1 second - 0 = 1000");
+ test.equal(moment(1000).diff(500), 500, "1 second - .5 second = -500");
+ test.equal(moment(0).diff(1000), -1000, "0 - 1 second = -1000");
+ test.equal(moment(new Date(1000)).diff(1000), 0, "1 second - 1 second = 0");
+ var oneHourDate = new Date(),
+ nowDate = new Date();
+ oneHourDate.setHours(oneHourDate.getHours() + 1);
+ test.equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, "1 hour from now = 360000");
+ test.done();
+ },
+
+ "diff key after" : function(test) {
+ test.expect(9);
+
+ test.equal(moment([2010]).diff([2011], 'years'), -1, "year diff");
+ test.equal(moment([2010]).diff([2011, 6], 'years', true), -1.5, "year diff, float");
+ test.equal(moment([2010]).diff([2010, 2], 'months'), -2, "month diff");
+ test.equal(moment([2010]).diff([2010, 0, 7], 'weeks'), -1, "week diff");
+ test.equal(moment([2010]).diff([2010, 0, 21], 'weeks'), -3, "week diff");
+ test.equal(moment([2010]).diff([2010, 0, 4], 'days'), -3, "day diff");
+ test.equal(moment([2010]).diff([2010, 0, 1, 4], 'hours'), -4, "hour diff");
+ test.equal(moment([2010]).diff([2010, 0, 1, 0, 5], 'minutes'), -5, "minute diff");
+ test.equal(moment([2010]).diff([2010, 0, 1, 0, 0, 6], 'seconds'), -6, "second diff");
+ test.done();
+ },
+
+ "diff key before" : function(test) {
+ test.expect(9);
+
+ test.equal(moment([2011]).diff([2010], 'years'), 1, "year diff");
+ test.equal(moment([2011, 6]).diff([2010], 'years', true), 1.5, "year diff, float");
+ test.equal(moment([2010, 2]).diff([2010], 'months'), 2, "month diff");
+ test.equal(moment([2010, 0, 4]).diff([2010], 'days'), 3, "day diff");
+ test.equal(moment([2010, 0, 7]).diff([2010], 'weeks'), 1, "week diff");
+ test.equal(moment([2010, 0, 21]).diff([2010], 'weeks'), 3, "week diff");
+ test.equal(moment([2010, 0, 1, 4]).diff([2010], 'hours'), 4, "hour diff");
+ test.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minutes'), 5, "minute diff");
+ test.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'seconds'), 6, "second diff");
+ test.done();
+ },
+
+ "diff month" : function(test) {
+ test.expect(1);
+
+ test.equal(moment([2011, 0, 31]).diff([2011, 2, 1], 'months'), -1, "month diff");
+ test.done();
+ },
+
+ "diff across DST" : function(test) {
+ test.expect(2);
+
+ test.equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'weeks', true), 2, "diff weeks across DST");
+ test.equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'days', true), 14, "diff weeks across DST");
+ test.done();
+ },
+
+ "diff overflow" : function(test) {
+ test.expect(4);
+
+ test.equal(moment([2011]).diff([2010], 'months'), 12, "month diff");
+ test.equal(moment([2010, 0, 2]).diff([2010], 'hours'), 24, "hour diff");
+ test.equal(moment([2010, 0, 1, 2]).diff([2010], 'minutes'), 120, "minute diff");
+ test.equal(moment([2010, 0, 1, 0, 4]).diff([2010], 'seconds'), 240, "second diff");
+ test.done();
+ }
+}
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.format = {
+ "format YY" : function(test) {
+ test.expect(1);
+
+ var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
+ test.equal(b.format('YY'), '09', 'YY ---> 09');
+ test.done();
+ },
+
+ "format escape brackets" : function(test) {
+ test.expect(5);
+
+ var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
+ test.equal(b.format('[day]'), 'day', 'Single bracket');
+ test.equal(b.format('[day] YY [YY]'), 'day 09 YY', 'Double bracket');
+ test.equal(b.format('[YY'), '[09', 'Un-ended bracket');
+ test.equal(b.format('[[YY]]'), '[YY]', 'Double nested brackets');
+ test.equal(b.format('[[]'), '[', 'Escape open bracket');
+ test.done();
+ },
+
+ "format timezone" : function(test) {
+ test.expect(4);
+
+ var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
+ test.ok(b.format('z').match(/^[A-Z]{3,5}$/), b.format('z') + ' ---> Something like "PST"');
+ test.ok(b.format('zz').match(/^[A-Z]{3,5}$/), b.format('zz') + ' ---> Something like "PST"');
+ test.ok(b.format('Z').match(/^[\+\-]\d\d:\d\d$/), b.format('Z') + ' ---> Something like "+07:30"');
+ test.ok(b.format('ZZ').match(/^[\+\-]\d{4}$/), b.format('ZZ') + ' ---> Something like "+0700"');
+ test.done();
+ },
+
+ "format multiple with zone" : function(test) {
+ test.expect(1);
+
+ var b = moment('2012-10-08 -1200', ['YYYY ZZ', 'YYYY-MM-DD ZZ']);
+ test.equals(b.format('YYYY-MM'), '2012-10', 'Parsing multiple formats should not crash with different sized formats');
+ test.done();
+ },
+
+ "isDST" : function(test) {
+ test.expect(2);
+
+ var janOffset = new Date(2011, 0, 1).getTimezoneOffset(),
+ julOffset = new Date(2011, 6, 1).getTimezoneOffset(),
+ janIsDst = janOffset < julOffset,
+ julIsDst = julOffset < janOffset,
+ jan1 = moment([2011]),
+ jul1 = moment([2011, 6]);
+
+ if (janIsDst && julIsDst) {
+ test.ok(0, 'January and July cannot both be in DST');
+ test.ok(0, 'January and July cannot both be in DST');
+ } else if (janIsDst) {
+ test.ok(jan1.isDST(), 'January 1 is DST');
+ test.ok(!jul1.isDST(), 'July 1 is not DST');
+ } else if (julIsDst) {
+ test.ok(!jan1.isDST(), 'January 1 is not DST');
+ test.ok(jul1.isDST(), 'July 1 is DST');
+ } else {
+ test.ok(!jan1.isDST(), 'January 1 is not DST');
+ test.ok(!jul1.isDST(), 'July 1 is not DST');
+ }
+ test.done();
+ },
+
+ "zone" : function(test) {
+ test.expect(3);
+
+ if (moment().zone() > 0) {
+ test.ok(moment().format('ZZ').indexOf('-') > -1, 'When the zone() offset is greater than 0, the ISO offset should be less than zero');
+ }
+ if (moment().zone() < 0) {
+ test.ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is less than 0, the ISO offset should be greater than zero');
+ }
+ if (moment().zone() == 0) {
+ test.ok(moment().format('ZZ').indexOf('+') > -1, 'When the zone() offset is equal to 0, the ISO offset should be positive zero');
+ }
+ test.ok(moment().zone() % 30 === 0, 'moment.fn.zone should be a multiple of 30 (was ' + moment().zone() + ')');
+ test.equal(moment().zone(), new Date().getTimezoneOffset(), 'zone should equal getTimezoneOffset');
+ test.done();
+ }
+}
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.getters_setters = {
+ "getters" : function(test) {
+ test.expect(8);
+
+ var a = moment([2011, 9, 12, 6, 7, 8, 9]);
+ test.equal(a.year(), 2011, 'year');
+ test.equal(a.month(), 9, 'month');
+ test.equal(a.date(), 12, 'date');
+ test.equal(a.day(), 3, 'day');
+ test.equal(a.hours(), 6, 'hour');
+ test.equal(a.minutes(), 7, 'minute');
+ test.equal(a.seconds(), 8, 'second');
+ test.equal(a.milliseconds(), 9, 'milliseconds');
+ test.done();
+ },
+
+ "setters" : function(test) {
+ test.expect(8);
+
+ var a = moment();
+ a.year(2011);
+ a.month(9);
+ a.date(12);
+ a.hours(6);
+ a.minutes(7);
+ a.seconds(8);
+ a.milliseconds(9);
+ test.equal(a.year(), 2011, 'year');
+ test.equal(a.month(), 9, 'month');
+ test.equal(a.date(), 12, 'date');
+ test.equal(a.day(), 3, 'day');
+ test.equal(a.hours(), 6, 'hour');
+ test.equal(a.minutes(), 7, 'minute');
+ test.equal(a.seconds(), 8, 'second');
+ test.equal(a.milliseconds(), 9, 'milliseconds');
+ test.done();
+ },
+
+ "setters - falsey values" : function(test) {
+ test.expect(1);
+
+ var a = moment();
+ // ensure minutes wasn't coincidentally 0 already
+ a.minutes(1);
+ a.minutes(0);
+ test.equal(a.minutes(), 0, 'falsey value');
+ test.done();
+ },
+
+ "chaining setters" : function(test) {
+ test.expect(7);
+
+ var a = moment();
+ a.year(2011)
+ .month(9)
+ .date(12)
+ .hours(6)
+ .minutes(7)
+ .seconds(8);
+ test.equal(a.year(), 2011, 'year');
+ test.equal(a.month(), 9, 'month');
+ test.equal(a.date(), 12, 'date');
+ test.equal(a.day(), 3, 'day');
+ test.equal(a.hours(), 6, 'hour');
+ test.equal(a.minutes(), 7, 'minute');
+ test.equal(a.seconds(), 8, 'second');
+ test.done();
+ },
+
+ "day setter" : function(test) {
+ test.expect(18);
+
+ var a = moment([2011, 0, 15]);
+ test.equal(moment(a).day(0).date(), 9, 'set from saturday to sunday');
+ test.equal(moment(a).day(6).date(), 15, 'set from saturday to saturday');
+ test.equal(moment(a).day(3).date(), 12, 'set from saturday to wednesday');
+
+ a = moment([2011, 0, 9]);
+ test.equal(moment(a).day(0).date(), 9, 'set from sunday to sunday');
+ test.equal(moment(a).day(6).date(), 15, 'set from sunday to saturday');
+ test.equal(moment(a).day(3).date(), 12, 'set from sunday to wednesday');
+
+ a = moment([2011, 0, 12]);
+ test.equal(moment(a).day(0).date(), 9, 'set from wednesday to sunday');
+ test.equal(moment(a).day(6).date(), 15, 'set from wednesday to saturday');
+ test.equal(moment(a).day(3).date(), 12, 'set from wednesday to wednesday');
+
+ test.equal(moment(a).day(-7).date(), 2, 'set from wednesday to last sunday');
+ test.equal(moment(a).day(-1).date(), 8, 'set from wednesday to last saturday');
+ test.equal(moment(a).day(-4).date(), 5, 'set from wednesday to last wednesday');
+
+ test.equal(moment(a).day(7).date(), 16, 'set from wednesday to next sunday');
+ test.equal(moment(a).day(13).date(), 22, 'set from wednesday to next saturday');
+ test.equal(moment(a).day(10).date(), 19, 'set from wednesday to next wednesday');
+
+ test.equal(moment(a).day(14).date(), 23, 'set from wednesday to second next sunday');
+ test.equal(moment(a).day(20).date(), 29, 'set from wednesday to second next saturday');
+ test.equal(moment(a).day(17).date(), 26, 'set from wednesday to second next wednesday');
+ test.done();
+ }
+};
\ No newline at end of file
--- /dev/null
+var moment = require("../../moment");
+
+exports.leapyear = {
+ "leap year" : function(test) {
+ test.expect(4);
+
+ test.equal(moment([2010, 0, 1]).isLeapYear(), false, '2010');
+ test.equal(moment([2100, 0, 1]).isLeapYear(), false, '2100');
+ test.equal(moment([2008, 0, 1]).isLeapYear(), true, '2008');
+ test.equal(moment([2000, 0, 1]).isLeapYear(), true, '2000');
+ test.done();
+ }
+};
--- /dev/null
+var moment = require("../../moment");
+
+exports.eod_sod = {
+ "sod" : function(test) {
+ test.expect(7);
+
+ var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).sod();
+ test.equal(m.year(), 2011, "keep the year");
+ test.equal(m.month(), 1, "keep the month");
+ test.equal(m.date(), 2, "keep the day");
+ test.equal(m.hours(), 0, "strip out the hours");
+ test.equal(m.minutes(), 0, "strip out the minutes");
+ test.equal(m.seconds(), 0, "strip out the seconds");
+ test.equal(m.milliseconds(), 0, "strip out the milliseconds");
+ test.done();
+ },
+
+ "eod" : function(test) {
+ test.expect(7);
+
+ var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).eod();
+ test.equal(m.year(), 2011, "keep the year");
+ test.equal(m.month(), 1, "keep the month");
+ test.equal(m.date(), 2, "keep the day");
+ test.equal(m.hours(), 23, "set the hours");
+ test.equal(m.minutes(), 59, "set the minutes");
+ test.equal(m.seconds(), 59, "set the seconds");
+ test.equal(m.milliseconds(), 999, "set the seconds");
+ test.done();
+ }
+}
\ No newline at end of file