From: Tim Wood Date: Thu, 3 Nov 2011 17:27:33 +0000 (-0700) Subject: Test paths for live site X-Git-Tag: 1.1.1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4b65712e291d59d6f637e992036edcb8fab280e;p=thirdparty%2Fmoment.git Test paths for live site --- diff --git a/build.js b/build.js index 0a2e2fd18..3351267fc 100755 --- a/build.js +++ b/build.js @@ -143,6 +143,7 @@ function hint(source, name) { } if (failures === 0) { minifyToFile(allSource, 'lang/all'); + minifyToFile(allSource, 'site/js/lang-all'); } })(); @@ -177,6 +178,7 @@ function hint(source, name) { makeDocs(); }); }); + minifyToFile(source, 'site/js/moment', MINIFY_COMMENT); } gzip(source, function(err, data) { SRCSIZE = source.length; diff --git a/lang/all.min.js b/lang/all.min.js index fddfdcb4f..7f00823a8 100644 --- a/lang/all.min.js +++ b/lang/all.min.js @@ -1 +1 @@ -(function(){var a={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"},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%100/10)===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:"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:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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:"Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fév_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"},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%100/10)===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:"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:{L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},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:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Feb_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:{L:"DD/MM/YYYY",LL:"D \\de MMMM \\de YYYY",LLL:"D \\de MMMM \\de YYYY HH:mm",LLLL:"dddd, D \\de MMMM \\de YYYY HH:mm"},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 diff --git a/lang/fr.min.js b/lang/fr.min.js index 50f84df8a..3ec5ff7c3 100644 --- a/lang/fr.min.js +++ b/lang/fr.min.js @@ -1 +1 @@ -(function(){var a={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"},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%100/10)===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_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),monthsShort:"Jan_Fév_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"},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%100/10)===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 diff --git a/lang/test/en.js b/lang/test/en.js index 601cf855f..36ce06675 100644 --- a/lang/test/en.js +++ b/lang/test/en.js @@ -132,6 +132,13 @@ test("suffix", 2, function() { 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"); diff --git a/lang/test/fr.js b/lang/test/fr.js index b8b8a7588..f4aba83a8 100644 --- a/lang/test/fr.js +++ b/lang/test/fr.js @@ -10,7 +10,7 @@ test("format", 19, function() { var a = [ ['dddd, MMMM Do YYYY, h:mm:ss a', 'Dimanche, Février 14er 2010, 3:25:50 pm'], ['ddd, hA', 'Dim, 3PM'], - ['M Mo MM MMMM MMM', '2 2ème 02 Février Fev'], + ['M Mo MM MMMM MMM', '2 2ème 02 Février Fév'], ['YYYY YY', '2010 10'], ['D Do DD', '14 14er 14'], ['d do dddd ddd', '0 0ème Dimanche Dim'], @@ -75,7 +75,7 @@ test("format ordinal", 31, function() { test("format month", 12, function() { moment.lang('fr'); - var expected = 'Janvier Jan_Février Fev_Mars Mar_Avril Avr_Mai Mai_Juin Juin_Juillet Juil_Aout Aou_Septembre Sep_Octobre Oct_Novembre Nov_Décembre Dec'.split("_"); + var expected = 'Janvier Jan_Février Fév_Mars Mar_Avril Avr_Mai Mai_Juin Juin_Juillet Juil_Aout Aou_Septembre Sep_Octobre Oct_Novembre Nov_Décembre Dec'.split("_"); var i; for (i = 0; i < expected.length; i++) { equal(moment([2011, i, 0]).format('MMMM MMM'), expected[i], expected[i]); diff --git a/moment.min.js b/moment.min.js index 0599921cf..5931d90aa 100755 --- a/moment.min.js +++ b/moment.min.js @@ -1,2 +1,2 @@ /* Moment.js | version : 1.1.0 | author : Tim Wood | license : MIT */ -(function(a,b){function k(a,b){var c=a+"";while(c.length11?"pm":"am";case"A":return i>11?"PM":"AM";case"H":return i;case"HH":return k(i,2);case"h":return i%12||12;case"hh":return k(i%12||12,2);case"m":return j;case"mm":return k(j,2);case"s":return l;case"ss":return k(l,2);case"zz":case"z":return(b.toString().match(p)||[""])[0].replace(n,"");case"L":case"LL":case"LLL":case"LLLL":return o(b,c.longDateFormat[d]);default:return d.replace("\\","")}}var e=b.getMonth(),f=b.getDate(),g=b.getFullYear(),h=b.getDay(),i=b.getHours(),j=b.getMinutes(),l=b.getSeconds(),m=/(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|LL?L?L?)/g,n=/[^A-Z]/g,p=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,q=c.ordinal;return d.replace(m,r)}function p(a,b){function i(a,b){switch(a){case"M":case"MM":c[1]=~~b-1;break;case"D":case"DD":case"DDD":case"DDDD":c[2]=~~b;break;case"YY":b=~~b,c[0]=b+(b>70?1900:2e3);break;case"YYYY":c[0]=~~b;break;case"a":case"A":h=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b}}var c=[0],d=/[0-9a-zA-Z]+/g,e=a.match(d),f=b.match(d),g,h;for(g=0;g11?"pm":"am";case"A":return i>11?"PM":"AM";case"H":return i;case"HH":return k(i,2);case"h":return i%12||12;case"hh":return k(i%12||12,2);case"m":return j;case"mm":return k(j,2);case"s":return l;case"ss":return k(l,2);case"zz":case"z":return(b.toString().match(p)||[""])[0].replace(n,"");case"L":case"LL":case"LLL":case"LLLL":return o(b,c.longDateFormat[d]);default:return d.replace("\\","")}}var e=b.getMonth(),f=b.getDate(),g=b.getFullYear(),h=b.getDay(),i=b.getHours(),j=b.getMinutes(),l=b.getSeconds(),m=/(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|LL?L?L?)/g,n=/[^A-Z]/g,p=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,q=c.ordinal;return d.replace(m,r)}function p(a,b){function i(a,b){switch(a){case"M":case"MM":c[1]=~~b-1;break;case"D":case"DD":case"DDD":case"DDDD":c[2]=~~b;break;case"YY":b=~~b,c[0]=b+(b>70?1900:2e3);break;case"YYYY":c[0]=~~b;break;case"a":case"A":h=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b}}var c=[0],d=/[0-9a-zA-Z]+/g,e=a.match(d),f=b.match(d),g,h;for(g=0;gSnippet :: Code View :: "+location.href+""+''+"
"+a+"
"+""),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;cv&&m(t.substring(v,B.index),null);var G=y[C],H=G[1],I;if(H instanceof Array)for(var J=0;J0){var d=c.split(" ");for(var e=0;e0&&b.push(d[e])}return b}function sh_addClass(a,b){var c=sh_getClasses(a);for(var d=0;d element with class="'+g+'", but no such language exists');continue}break}}}(function(a,b){function k(a,b){var c=a+"";while(c.length11?"pm":"am";case"A":return i>11?"PM":"AM";case"H":return i;case"HH":return k(i,2);case"h":return i%12||12;case"hh":return k(i%12||12,2);case"m":return j;case"mm":return k(j,2);case"s":return l;case"ss":return k(l,2);case"zz":case"z":return(b.toString().match(p)||[""])[0].replace(n,"");case"L":case"LL":case"LLL":case"LLLL":return o(b,c.longDateFormat[d]);default:return d.replace("\\","")}}var e=b.getMonth(),f=b.getDate(),g=b.getFullYear(),h=b.getDay(),i=b.getHours(),j=b.getMinutes(),l=b.getSeconds(),m=/(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|zz?|LL?L?L?)/g,n=/[^A-Z]/g,p=/\([A-Za-z ]+\)|:[0-9]{2} [A-Z]{3} /g,q=c.ordinal;return d.replace(m,r)}function p(a,b){function i(a,b){switch(a){case"M":case"MM":c[1]=~~b-1;break;case"D":case"DD":case"DDD":case"DDDD":c[2]=~~b;break;case"YY":b=~~b,c[0]=b+(b>70?1900:2e3);break;case"YYYY":c[0]=~~b;break;case"a":case"A":h=b.toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b}}var c=[0],d=/[0-9a-zA-Z]+/g,e=a.match(d),f=b.match(d),g,h;for(g=0;g' 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 ";return console.log(l),!1}g.addClass("sh_"+b).addClass("snippet-formatted").wrap("
"),g.removeAttr("style"),sh_highlightDocument();if(d.showNum){var m=g.html();m=m.replace(/\n/g,"
  • "),m="
    1. "+m+"
    ";while(m.indexOf("
  • ")!=-1)m=m.replace("
  • ","")}else{var m=g.html();m=m.replace(/\n/g,"
  • "),m="
    • "+m+"
    ";while(m.indexOf("
  • ")!=-1)m=m.replace("
  • ","")}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(" "))}});var n="",o="";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="",u="";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=" ",y=d.box.split(",");for(var z=0;z");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("
      ");var F=g.find("li").eq(0);F.unwrap()}}if(d.box!=""){var x=" ",y=d.box.split(",");for(var z=0;z-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+=''}else c+='';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|\|/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],[/(?:?)|(?:?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[//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",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[//g,"sh_comment",-2],[/ "+a[b][1])}),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")}),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),equal(a.add({ms:1e3}).seconds(),9,"Add milliseconds"),equal(a.add({s:1}).seconds(),10,"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}),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),equal(a.add({milliseconds:1e3}).seconds(),9,"Add milliseconds"),equal(a.add({seconds:1}).seconds(),10,"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",8,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.seconds(8),equal(a.add("milliseconds",1e3).seconds(),9,"Add milliseconds"),equal(a.add("seconds",1).seconds(),10,"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",8,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.seconds(8),equal(a.add("ms",1e3).seconds(),9,"Add milliseconds"),equal(a.add("s",1).seconds(),10,"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")}),module("diff"),test("diff",5,function(){equal(moment(1e3).diff(0),1e3,"1 second - 0 = 1000"),equal(moment(1e3).diff(500),500,"1 second - .5 second = -500"),equal(moment(0).diff(1e3),-1e3,"0 - 1 second = -1000"),equal(moment(new Date(1e3)).diff(1e3),0,"1 second - 1 second = 0");var a=new Date,b=new Date;a.setHours(a.getHours()+1),equal(moment(a).diff(b),36e5,"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",!0),-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",!0),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 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(),!1,"2010"),equal(moment([2100,0,1]).isLeapYear(),!1,"2100"),equal(moment([2008,0,1]).isLeapYear(),!0,"2008"),equal(moment([2e3,0,1]).isLeapYear(),!0,"2000")}),module("getters and setters"),test("getters",7,function(){var a=moment([2011,9,12,6,7,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("setters",7,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.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("setters - falsey values",1,function(){var a=moment();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")});var moment;typeof window=="undefined"&&(moment=require("../../moment.js"),module=QUnit.module),module("lang:en"),test("format",19,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"],["z zz","PST PST"],["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)),c;for(c=0;c "+a[c][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 a="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("_"),b;for(b=0;b "+a[c][1])}),test("format ordinal",31,function(){moment.lang("fr"),equal(moment([2011,0,1]).format("DDDo"),"1ème","1ème"),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"),"10er","10er"),equal(moment([2011,0,11]).format("DDDo"),"11er","11er"),equal(moment([2011,0,12]).format("DDDo"),"12er","12er"),equal(moment([2011,0,13]).format("DDDo"),"13er","13er"),equal(moment([2011,0,14]).format("DDDo"),"14er","14er"),equal(moment([2011,0,15]).format("DDDo"),"15er","15er"),equal(moment([2011,0,16]).format("DDDo"),"16er","16er"),equal(moment([2011,0,17]).format("DDDo"),"17er","17er"),equal(moment([2011,0,18]).format("DDDo"),"18er","18er"),equal(moment([2011,0,19]).format("DDDo"),"19er","19er"),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 a="Janvier Jan_Février Fev_Mars Mar_Avril Avr_Mai Mai_Juin Juin_Juillet Juil_Aout Aou_Septembre Sep_Octobre Oct_Novembre Nov_Décembre Dec".split("_"),b;for(b=0;b "+a[c][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 a="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("_"),b;for(b=0;b "+a[c][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 a="Janeiro Jan_Fevereiro Feb_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez".split("_"),b;for(b=0;b",'',d,' tests of ',f.stats.all,' passed, ',f.stats.bad," failed."].join("");a&&(a.className=f.stats.bad?"qunit-fail":"qunit-pass"),b&&(s("qunit-testresult").innerHTML=g),e.done({failed:f.stats.bad,passed:d,total:f.stats.all,runtime:c})}function h(a){var b=f.filters.length,c=!1;if(!b)return!0;while(b--){var d=f.filters[b],e=d.charAt(0)=="!";e&&(d=d.slice(1));if(a.indexOf(d)!==-1)return!e;e&&(c=!0)}return c}function i(){try{throw new Error}catch(a){if(a.stacktrace)return a.stacktrace.split("\n")[6];if(a.stack)return a.stack.split("\n")[4]}}function j(a){return a?(a+="",a.replace(/[\&"<>\\]/g,function(a){switch(a){case"&":return"&";case"\\":return"\\\\";case'"':return'"';case"<":return"<";case">":return">";default:return a}})):""}function k(a){f.queue.push(a),f.autorun&&!f.blocking&&l()}function l(){var b=(new Date).getTime();while(f.queue.length&&!f.blocking)if(f.updateRate<=0||(new Date).getTime()-b0&&(ok(!1,"Introduced global variable(s): "+c.join(", ")),f.current.expected++);var d=o(f.pollution,b);d.length>0&&(ok(!1,"Deleted global variable(s): "+d.join(", ")),f.current.expected++)}function o(a,b){var c=a.slice();for(var d=0;d("+d+", "+c+", "+this.assertions.length+")",r(l,"click",function(){var a=l.nextSibling,b=a.style.display;a.style.display=b==="none"?"block":"none"}),r(l,"dblclick",function(b){var c=b&&b.target?b.target:a.event.srcElement;if(c.nodeName.toLowerCase()=="span"||c.nodeName.toLowerCase()=="b")c=c.parentNode;a.location&&c.nodeName.toLowerCase()==="strong"&&(a.location.search="?"+encodeURIComponent(t([c]).replace(/\(.+\)$/,"").replace(/(^\s*|\s*$)/g,"")))});var k=s(this.id);k.className=d?"fail":"pass",k.removeChild(k.firstChild),k.appendChild(l),k.appendChild(h)}else for(var i=0;i",i;arguments.length===2&&(c=b,b=null),b&&typeof b=="object"&&(i=b,b=null),f.currentModule&&(g=''+f.currentModule+": "+g);if(!h(f.currentModule+": "+a))return;var j=new d(g,a,b,i,e,c);j.module=f.currentModule,j.moduleTestEnvironment=f.currentModuleTestEnviroment,j.queue()},expect:function(a){f.current.expected=a},ok:function(a,b){a=!!a;var c={result:a,message:b};b=j(b),e.log(c),f.current.assertions.push({result:a,message:b})},equal:function(a,b,c){e.push(b==a,a,b,c)},notEqual:function(a,b,c){e.push(b!=a,a,b,c)},deepEqual:function(a,b,c){e.push(e.equiv(a,b),a,b,c)},notDeepEqual:function(a,b,c){e.push(!e.equiv(a,b),a,b,c)},strictEqual:function(a,b,c){e.push(b===a,a,b,c)},notStrictEqual:function(a,b,c){e.push(b!==a,a,b,c)},raises:function(a,b,c){var d,f=!1;typeof b=="string"&&(c=b,b=null);try{a()}catch(g){d=g}d&&(b?e.objectType(b)==="regexp"?f=b.test(d):d instanceof b?f=!0:b.call({},d)===!0&&(f=!0):f=!0),e.ok(f,c)},start:function(){f.semaphore--;if(f.semaphore>0)return;f.semaphore<0&&(f.semaphore=0),b.setTimeout?a.setTimeout(function(){f.timeout&&clearTimeout(f.timeout),f.blocking=!1,l()},13):(f.blocking=!1,l())},stop:function(c){f.semaphore++,f.blocking=!0,c&&b.setTimeout&&(clearTimeout(f.timeout),f.timeout=a.setTimeout(function(){e.ok(!1,"Test timed out"),e.start()},c))}};e.equals=e.equal,e.same=e.deepEqual;var f={queue:[],blocking:!0,reorder:!0};(function(){var b=a.location||{search:"",protocol:"file:"},c=b.search.slice(1).split("&");for(var d=0;d-1&&(c.splice(d,1),d--);f.filters=c,e.isLocal=b.protocol==="file:"})(),typeof exports=="undefined"||typeof require=="undefined"?(q(a,e),a.QUnit=e):(q(exports,e),exports.QUnit=e),q(e,{config:f,init:function(){q(f,{stats:{all:0,bad:0},moduleStats:{all:0,bad:0},started:+(new Date),updateRate:1e3,blocking:!1,autostart:!0,autorun:!1,filters:[],queue:[],semaphore:0});var a=s("qunit-tests"),b=s("qunit-banner"),c=s("qunit-testresult");a&&(a.innerHTML=""),b&&(b.className=""),c&&c.parentNode.removeChild(c),a&&(c=document.createElement("p"),c.id="qunit-testresult",c.className="result",a.parentNode.insertBefore(c,a),c.innerHTML="Running...
       ")},reset:function(){if(a.jQuery)jQuery("#main, #qunit-fixture").html(f.fixture);else{var b=s("main")||s("qunit-fixture");b&&(b.innerHTML=f.fixture)}},triggerEvent:function(a,b,c){document.createEvent?(c=document.createEvent("MouseEvents"),c.initMouseEvent(b,!0,!0,a.ownerDocument.defaultView,0,0,0,0,0,!1,!1,!1,!1,0,null),a.dispatchEvent(c)):a.fireEvent&&a.fireEvent("on"+b)},is:function(a,b){return e.objectType(b)==a},objectType:function(a){if(typeof a=="undefined")return"undefined";if(a===null)return"null";var b=Object.prototype.toString.call(a).match(/^\[object\s(.*)\]$/)[1]||"";switch(b){case"Number":return isNaN(a)?"nan":"number";case"String":case"Boolean":case"Array":case"Date":case"RegExp":case"Function":return b.toLowerCase()}return typeof a=="object"?"object":undefined},push:function(a,b,c,d){var g={result:a,message:d,actual:b,expected:c};d=j(d)||(a?"okay":"failed"),d=''+d+"",c=j(e.jsDump.parse(c)),b=j(e.jsDump.parse(b));var h=d+'";b!=c&&(h+='",h+='");if(!a){var k=i();k&&(g.source=k,h+='")}h+="
      Expected:
      '+c+"
      Result:
      '+b+"
      Diff:
      '+e.diff(c,b)+"
      Source:
      '+k+"
      ",e.log(g),f.current.assertions.push({result:!!a,message:h})},begin:function(){},done:function(){},log:function(){},testStart:function(){},testDone:function(){},moduleStart:function(){},moduleDone:function(){}});if(typeof document=="undefined"||document.readyState==="complete")f.autorun=!0;r(a,"load",function(){e.begin({});var a=q({},f);e.init(),q(f,a),f.blocking=!1;var c=s("qunit-userAgent");c&&(c.innerHTML=navigator.userAgent);var d=s("qunit-header");if(d){var g=location.href.lastIndexOf(location.search);if(g>-1){var h=location.href.slice(0,g);if(h==location.href)d.innerHTML=' '+d.innerHTML+" ";else{var i=decodeURIComponent(location.search.slice(1));d.innerHTML=''+d.innerHTML+''+i+""}}}var j=s("qunit-testrunner-toolbar");if(j){var k=document.createElement("input");k.type="checkbox",k.id="qunit-filter-pass",r(k,"click",function(){var a=document.getElementById("qunit-tests");if(k.checked)a.className=a.className+" hidepass";else{var c=" "+a.className.replace(/[\n\t\r]/g," ")+" ";a.className=c.replace(/ hidepass /," ")}b.sessionStorage&&sessionStorage.setItem("qunit-filter-passed-tests",k.checked?"true":"")});if(b.sessionStorage&&sessionStorage.getItem("qunit-filter-passed-tests")){k.checked=!0;var l=document.getElementById("qunit-tests");l.className=l.className+" hidepass"}j.appendChild(k);var m=document.createElement("label");m.setAttribute("for","qunit-filter-pass"),m.innerHTML="Hide passed tests",j.appendChild(m)}var n=s("main")||s("qunit-fixture");n&&(f.fixture=n.innerHTML),f.autostart&&e.start()}),e.equiv=function(){function d(a,b,c){var d=e.objectType(a);if(d)return e.objectType(b[d])==="function"?b[d].apply(b,c):b[d]}var a,b=[],c=[],f=function(){function d(a,b){return a instanceof b.constructor||b instanceof a.constructor?b==a:b===a}return{string:d,"boolean":d,number:d,"null":d,"undefined":d,nan:function(a){return isNaN(a)},date:function(a,b){return e.objectType(a)==="date"&&b.valueOf()===a.valueOf()},regexp:function(a,b){return e.objectType(a)==="regexp"&&b.source===a.source&&b.global===a.global&&b.ignoreCase===a.ignoreCase&&b.multiline===a.multiline},"function":function(){var a=b[b.length-1];return a!==Object&&typeof a!="undefined"},array:function(b,d){var f,g,h,i;if(e.objectType(b)!=="array")return!1;i=d.length;if(i!==b.length)return!1;c.push(d);for(f=0;f=0?b="array":b=typeof a,b},separator:function(){return this.multiline?this.HTML?"
      ":"\n":this.HTML?" ":" "},indent:function(a){if(!this.multiline)return"";var b=this.indentChar;return this.HTML&&(b=b.replace(/\t/g," ").replace(/ /g," ")),Array(this._depth_+(a||0)).join(b)},up:function(a){this._depth_+=a||1},down:function(a){this._depth_-=a||1},setParser:function(a,b){this.parsers[a]=b},quote:a,literal:b,join:c,_depth_:1,parsers:{window:"[Window]",document:"[Document]",error:"[ERROR]",unknown:"[Unknown]","null":"null","undefined":"undefined","function":function(a){var b="function",d="name"in a?a.name:(f.exec(a)||[])[1];return d&&(b+=" "+d),b+="(",b=[b,e.jsDump.parse(a,"functionArgs"),"){"].join(""),c(b,e.jsDump.parse(a,"functionCode"),"}")},array:d,nodelist:d,arguments:d,object:function(a){var b=[];e.jsDump.up();for(var d in a)b.push(e.jsDump.parse(d,"key")+": "+e.jsDump.parse(a[d]));return e.jsDump.down(),c("{",b,"}")},node:function(a){var b=e.jsDump.HTML?"<":"<",c=e.jsDump.HTML?">":">",d=a.nodeName.toLowerCase(),f=b+d;for(var g in e.jsDump.DOMAttrs){var h=a[e.jsDump.DOMAttrs[g]];h&&(f+=" "+g+"="+e.jsDump.parse(h,"attribute"))}return f+c+b+"/"+d+c},functionArgs:function(a){var b=a.length;if(!b)return"";var c=Array(b);while(b--)c[b]=String.fromCharCode(97+b);return" "+c.join(", ")+" "},key:a,functionCode:"[code]",attribute:a,string:a,date:a,regexp:b,number:b,"boolean":b},DOMAttrs:{id:"id",name:"name","class":"className"},HTML:!1,indentChar:" ",multiline:!0};return g}(),e.diff=function(){function a(a,b){var c=new Object,d=new Object;for(var e=0;e0;e--)b[e].text!=null&&b[e-1].text==null&&b[e].row>0&&a[b[e].row-1].text==null&&b[e-1]==a[b[e].row-1]&&(b[e-1]={text:b[e-1],row:b[e].row-1},a[b[e].row-1]={text:a[b[e].row-1],row:e-1});return{o:a,n:b}}return function(b,c){b=b.replace(/\s+$/,""),c=c.replace(/\s+$/,"");var d=a(b==""?[]:b.split(/\s+/),c==""?[]:c.split(/\s+/)),e="",f=b.match(/\s+/g);f==null?f=[" "]:f.push(" ");var g=c.match(/\s+/g);g==null?g=[" "]:g.push(" ");if(d.n.length==0)for(var h=0;h"+d.o[h]+f[h]+"";else{if(d.n[0].text==null)for(c=0;c"+d.o[c]+f[c]+"";for(var h=0;h"+d.n[h]+g[h]+"";else{var i="";for(c=d.n[h].row+1;c"+d.o[c]+f[c]+"";e+=" "+d.n[h].text+g[h]+i}}return e}}()})(this);var moment;typeof window=="undefined"&&(moment=require("../../moment"),module=QUnit.module),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(1e3).native()instanceof Date,"1000"),ok(moment(1e3).valueOf()===1e3,"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 with format",11,function(){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"]],b;for(b=0;b "+a[b][1])}),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")}),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),equal(a.add({ms:1e3}).seconds(),9,"Add milliseconds"),equal(a.add({s:1}).seconds(),10,"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}),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),equal(a.add({milliseconds:1e3}).seconds(),9,"Add milliseconds"),equal(a.add({seconds:1}).seconds(),10,"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",8,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.seconds(8),equal(a.add("milliseconds",1e3).seconds(),9,"Add milliseconds"),equal(a.add("seconds",1).seconds(),10,"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",8,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.seconds(8),equal(a.add("ms",1e3).seconds(),9,"Add milliseconds"),equal(a.add("s",1).seconds(),10,"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")}),module("diff"),test("diff",5,function(){equal(moment(1e3).diff(0),1e3,"1 second - 0 = 1000"),equal(moment(1e3).diff(500),500,"1 second - .5 second = -500"),equal(moment(0).diff(1e3),-1e3,"0 - 1 second = -1000"),equal(moment(new Date(1e3)).diff(1e3),0,"1 second - 1 second = 0");var a=new Date,b=new Date;a.setHours(a.getHours()+1),equal(moment(a).diff(b),36e5,"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",!0),-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",!0),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 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(),!1,"2010"),equal(moment([2100,0,1]).isLeapYear(),!1,"2100"),equal(moment([2008,0,1]).isLeapYear(),!0,"2008"),equal(moment([2e3,0,1]).isLeapYear(),!0,"2000")}),module("getters and setters"),test("getters",7,function(){var a=moment([2011,9,12,6,7,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("setters",7,function(){var a=moment();a.year(2011),a.month(9),a.date(12),a.hours(6),a.minutes(7),a.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("setters - falsey values",1,function(){var a=moment();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")});var moment;typeof window=="undefined"&&(moment=require("../../moment.js"),module=QUnit.module),module("lang:en"),test("format",19,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"],["z zz","PST PST"],["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)),c;for(c=0;c "+a[c][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 a="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("_"),b;for(b=0;b "+a[c][1])}),test("format ordinal",31,function(){moment.lang("fr"),equal(moment([2011,0,1]).format("DDDo"),"1ème","1ème"),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"),"10er","10er"),equal(moment([2011,0,11]).format("DDDo"),"11er","11er"),equal(moment([2011,0,12]).format("DDDo"),"12er","12er"),equal(moment([2011,0,13]).format("DDDo"),"13er","13er"),equal(moment([2011,0,14]).format("DDDo"),"14er","14er"),equal(moment([2011,0,15]).format("DDDo"),"15er","15er"),equal(moment([2011,0,16]).format("DDDo"),"16er","16er"),equal(moment([2011,0,17]).format("DDDo"),"17er","17er"),equal(moment([2011,0,18]).format("DDDo"),"18er","18er"),equal(moment([2011,0,19]).format("DDDo"),"19er","19er"),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 a="Janvier Jan_Février Fév_Mars Mar_Avril Avr_Mai Mai_Juin Juin_Juillet Juil_Aout Aou_Septembre Sep_Octobre Oct_Novembre Nov_Décembre Dec".split("_"),b;for(b=0;b "+a[c][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 a="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("_"),b;for(b=0;b "+a[c][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 a="Janeiro Jan_Fevereiro Feb_Março Mar_Abril Abr_Maio Mai_Junho Jun_Julho Jul_Agosto Ago_Setembro Set_Outubro Out_Novembro Nov_Dezembro Dez".split("_"),b;for(b=0;bMoment.js Unit Test Suite

      Moment.js unit test suite