Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #39 from jgwhite/master

Moment.format('YY') Returns Zero-filled Year
  • Loading branch information...
commit ca2da0216dccf8e47149e2bd4c1ca710913277ba 2 parents a4b6571 + 2bc6a3d
Tim Wood timrwood authored
2  moment.js
@@ -139,7 +139,7 @@
139 139 return leftZeroFill(replaceFunction('w'), 2);
140 140 // YEAR
141 141 case 'YY' :
142   - return currentYear % 100;
  142 + return leftZeroFill(currentYear % 100, 2);
143 143 case 'YYYY' :
144 144 return currentYear;
145 145 // AM / PM
2  moment.min.js
... ... @@ -1,2 +1,2 @@
1 1 /* Moment.js | version : 1.1.0 | author : Tim Wood | license : MIT */
2   -(function(a,b){function k(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function l(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j;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+(g.d||g.days||0)*864e5+(g.w||g.weeks||0)*6048e5,i=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&(j=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+i*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),j))),b}function m(a){return Object.prototype.toString.call(a)==="[object Array]"}function n(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 o(b,d){function r(d){var m,s;switch(d){case"M":return e+1;case"Mo":return e+1+q(e+1);case"MM":return k(e+1,2);case"MMM":return c.monthsShort[e];case"MMMM":return c.months[e];case"D":return f;case"Do":return f+q(f);case"DD":return k(f,2);case"DDD":return m=new a(g,e,f),s=new a(g,0,1),~~((m-s)/864e5+1.5);case"DDDo":return m=r("DDD"),m+q(m);case"DDDD":return k(r("DDD"),3);case"d":return h;case"do":return h+q(h);case"ddd":return c.weekdaysShort[h];case"dddd":return c.weekdays[h];case"w":return m=new a(g,e,f-h+5),s=new a(m.getFullYear(),0,4),~~((m-s)/864e5/7+1.5);case"wo":return m=r("w"),m+q(m);case"ww":return k(r("w"),2);case"YY":return g%100;case"YYYY":return g;case"a":return i>11?"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<f.length;g++)i(f[g],e[g]);return h&&c[3]<12&&(c[3]+=12),n(c)}function q(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 r(a,b){var c,d=/[0-9a-zA-Z]+/g,e=a.match(d),f=[],g=99,h,i,j;for(h=0;h<b.length;h++)i=p(a,b[h]),j=q(e,o(i,b[h]).match(d)),j<g&&(g=j,c=i);return c}function s(a){this._d=a}function t(a,b){return c.relativeTime[a].replace(/%d/i,b||1)}function u(a){var b=Math.abs(a)/1e3,c=b/60,e=c/60,f=e/24,g=f/365;return b<45&&t("s",d(b))||d(c)===1&&t("m")||c<45&&t("mm",d(c))||d(e)===1&&t("h")||e<22&&t("hh",d(e))||d(f)===1&&t("d")||f<=25&&t("dd",d(f))||f<=45&&t("M")||f<345&&t("MM",d(f/30))||d(g)===1&&t("y")||t("yy",d(g))}function v(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|weekdays|weekdaysShort|longDateFormat|relativeTime|ordinal".split("|"),h,i="1.1.0",j="Month|Date|Hours|Minutes|Seconds".split("|");c=function(c,d){var e;return c&&c._d instanceof a?e=c._d:d?m(d)?e=r(c,d):e=p(c,d):e=c===b?new a:c instanceof a?c:m(c)?n(c):new a(c),new s(e)},c.version=i,c.lang=function(a,b){var d,h,i;b&&(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:{L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm A",LLLL:"dddd, MMMM D YYYY h:mm A"},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=s.prototype={valueOf:function(){return+this._d},"native":function(){return this._d},format:function(a){return o(this._d,a)},add:function(a,b){return this._d=l(this._d,a,1,b),this},subtract:function(a,b){return this._d=l(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=this._d-f._d,h=this.year()-f.year(),i=this.month()-f.month(),j=this.day()-f.day(),k;return b==="months"?k=h*12+i+j/30:b==="years"?k=h+i/12:k=b==="seconds"?g/1e3:b==="minutes"?g/6e4:b==="hours"?g/36e5:b==="days"?g/864e5:b==="weeks"?g/6048e5:b==="days"?g/3600:g,e?k:d(k)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=u(d);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},isLeapYear:function(){var a=this._d.getFullYear();return a%4===0&&a%100!==0||a%400===0}};for(h=0;h<j.length;h++)v(j[h].toLowerCase(),j[h]);v("year","FullYear"),c.fn.day=function(){return this._d.getDay()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c)})(Date)
  2 +(function(a,b){function k(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function l(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j;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+(g.d||g.days||0)*864e5+(g.w||g.weeks||0)*6048e5,i=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&(j=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+i*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),j))),b}function m(a){return Object.prototype.toString.call(a)==="[object Array]"}function n(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 o(b,d){function r(d){var m,s;switch(d){case"M":return e+1;case"Mo":return e+1+q(e+1);case"MM":return k(e+1,2);case"MMM":return c.monthsShort[e];case"MMMM":return c.months[e];case"D":return f;case"Do":return f+q(f);case"DD":return k(f,2);case"DDD":return m=new a(g,e,f),s=new a(g,0,1),~~((m-s)/864e5+1.5);case"DDDo":return m=r("DDD"),m+q(m);case"DDDD":return k(r("DDD"),3);case"d":return h;case"do":return h+q(h);case"ddd":return c.weekdaysShort[h];case"dddd":return c.weekdays[h];case"w":return m=new a(g,e,f-h+5),s=new a(m.getFullYear(),0,4),~~((m-s)/864e5/7+1.5);case"wo":return m=r("w"),m+q(m);case"ww":return k(r("w"),2);case"YY":return k(g%100,2);case"YYYY":return g;case"a":return i>11?"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<f.length;g++)i(f[g],e[g]);return h&&c[3]<12&&(c[3]+=12),n(c)}function q(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 r(a,b){var c,d=/[0-9a-zA-Z]+/g,e=a.match(d),f=[],g=99,h,i,j;for(h=0;h<b.length;h++)i=p(a,b[h]),j=q(e,o(i,b[h]).match(d)),j<g&&(g=j,c=i);return c}function s(a){this._d=a}function t(a,b){return c.relativeTime[a].replace(/%d/i,b||1)}function u(a){var b=Math.abs(a)/1e3,c=b/60,e=c/60,f=e/24,g=f/365;return b<45&&t("s",d(b))||d(c)===1&&t("m")||c<45&&t("mm",d(c))||d(e)===1&&t("h")||e<22&&t("hh",d(e))||d(f)===1&&t("d")||f<=25&&t("dd",d(f))||f<=45&&t("M")||f<345&&t("MM",d(f/30))||d(g)===1&&t("y")||t("yy",d(g))}function v(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|weekdays|weekdaysShort|longDateFormat|relativeTime|ordinal".split("|"),h,i="1.1.0",j="Month|Date|Hours|Minutes|Seconds".split("|");c=function(c,d){var e;return c&&c._d instanceof a?e=c._d:d?m(d)?e=r(c,d):e=p(c,d):e=c===b?new a:c instanceof a?c:m(c)?n(c):new a(c),new s(e)},c.version=i,c.lang=function(a,b){var d,h,i;b&&(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:{L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm A",LLLL:"dddd, MMMM D YYYY h:mm A"},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=s.prototype={valueOf:function(){return+this._d},"native":function(){return this._d},format:function(a){return o(this._d,a)},add:function(a,b){return this._d=l(this._d,a,1,b),this},subtract:function(a,b){return this._d=l(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=this._d-f._d,h=this.year()-f.year(),i=this.month()-f.month(),j=this.day()-f.day(),k;return b==="months"?k=h*12+i+j/30:b==="years"?k=h+i/12:k=b==="seconds"?g/1e3:b==="minutes"?g/6e4:b==="hours"?g/36e5:b==="days"?g/864e5:b==="weeks"?g/6048e5:b==="days"?g/3600:g,e?k:d(k)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=u(d);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},isLeapYear:function(){var a=this._d.getFullYear();return a%4===0&&a%100!==0||a%400===0}};for(h=0;h<j.length;h++)v(j[h].toLowerCase(),j[h]);v("year","FullYear"),c.fn.day=function(){return this._d.getDay()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c)})(Date)
2  site/js/home.min.js
1 addition, 1 deletion not shown
2  site/js/moment.min.js
... ... @@ -1,2 +1,2 @@
1 1 /* Moment.js | version : 1.1.0 | author : Tim Wood | license : MIT */
2   -(function(a,b){function k(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function l(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j;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+(g.d||g.days||0)*864e5+(g.w||g.weeks||0)*6048e5,i=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&(j=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+i*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),j))),b}function m(a){return Object.prototype.toString.call(a)==="[object Array]"}function n(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 o(b,d){function r(d){var m,s;switch(d){case"M":return e+1;case"Mo":return e+1+q(e+1);case"MM":return k(e+1,2);case"MMM":return c.monthsShort[e];case"MMMM":return c.months[e];case"D":return f;case"Do":return f+q(f);case"DD":return k(f,2);case"DDD":return m=new a(g,e,f),s=new a(g,0,1),~~((m-s)/864e5+1.5);case"DDDo":return m=r("DDD"),m+q(m);case"DDDD":return k(r("DDD"),3);case"d":return h;case"do":return h+q(h);case"ddd":return c.weekdaysShort[h];case"dddd":return c.weekdays[h];case"w":return m=new a(g,e,f-h+5),s=new a(m.getFullYear(),0,4),~~((m-s)/864e5/7+1.5);case"wo":return m=r("w"),m+q(m);case"ww":return k(r("w"),2);case"YY":return g%100;case"YYYY":return g;case"a":return i>11?"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<f.length;g++)i(f[g],e[g]);return h&&c[3]<12&&(c[3]+=12),n(c)}function q(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 r(a,b){var c,d=/[0-9a-zA-Z]+/g,e=a.match(d),f=[],g=99,h,i,j;for(h=0;h<b.length;h++)i=p(a,b[h]),j=q(e,o(i,b[h]).match(d)),j<g&&(g=j,c=i);return c}function s(a){this._d=a}function t(a,b){return c.relativeTime[a].replace(/%d/i,b||1)}function u(a){var b=Math.abs(a)/1e3,c=b/60,e=c/60,f=e/24,g=f/365;return b<45&&t("s",d(b))||d(c)===1&&t("m")||c<45&&t("mm",d(c))||d(e)===1&&t("h")||e<22&&t("hh",d(e))||d(f)===1&&t("d")||f<=25&&t("dd",d(f))||f<=45&&t("M")||f<345&&t("MM",d(f/30))||d(g)===1&&t("y")||t("yy",d(g))}function v(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|weekdays|weekdaysShort|longDateFormat|relativeTime|ordinal".split("|"),h,i="1.1.0",j="Month|Date|Hours|Minutes|Seconds".split("|");c=function(c,d){var e;return c&&c._d instanceof a?e=c._d:d?m(d)?e=r(c,d):e=p(c,d):e=c===b?new a:c instanceof a?c:m(c)?n(c):new a(c),new s(e)},c.version=i,c.lang=function(a,b){var d,h,i;b&&(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:{L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm A",LLLL:"dddd, MMMM D YYYY h:mm A"},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=s.prototype={valueOf:function(){return+this._d},"native":function(){return this._d},format:function(a){return o(this._d,a)},add:function(a,b){return this._d=l(this._d,a,1,b),this},subtract:function(a,b){return this._d=l(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=this._d-f._d,h=this.year()-f.year(),i=this.month()-f.month(),j=this.day()-f.day(),k;return b==="months"?k=h*12+i+j/30:b==="years"?k=h+i/12:k=b==="seconds"?g/1e3:b==="minutes"?g/6e4:b==="hours"?g/36e5:b==="days"?g/864e5:b==="weeks"?g/6048e5:b==="days"?g/3600:g,e?k:d(k)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=u(d);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},isLeapYear:function(){var a=this._d.getFullYear();return a%4===0&&a%100!==0||a%400===0}};for(h=0;h<j.length;h++)v(j[h].toLowerCase(),j[h]);v("year","FullYear"),c.fn.day=function(){return this._d.getDay()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c)})(Date)
  2 +(function(a,b){function k(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function l(b,c,d,e){var f=typeof c=="string",g=f?{}:c,h,i,j;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+(g.d||g.days||0)*864e5+(g.w||g.weeks||0)*6048e5,i=(g.M||g.months||0)+(g.y||g.years||0)*12,h&&b.setTime(+b+h*d),i&&(j=b.getDate(),b.setDate(1),b.setMonth(b.getMonth()+i*d),b.setDate(Math.min((new a(b.getFullYear(),b.getMonth()+1,0)).getDate(),j))),b}function m(a){return Object.prototype.toString.call(a)==="[object Array]"}function n(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 o(b,d){function r(d){var m,s;switch(d){case"M":return e+1;case"Mo":return e+1+q(e+1);case"MM":return k(e+1,2);case"MMM":return c.monthsShort[e];case"MMMM":return c.months[e];case"D":return f;case"Do":return f+q(f);case"DD":return k(f,2);case"DDD":return m=new a(g,e,f),s=new a(g,0,1),~~((m-s)/864e5+1.5);case"DDDo":return m=r("DDD"),m+q(m);case"DDDD":return k(r("DDD"),3);case"d":return h;case"do":return h+q(h);case"ddd":return c.weekdaysShort[h];case"dddd":return c.weekdays[h];case"w":return m=new a(g,e,f-h+5),s=new a(m.getFullYear(),0,4),~~((m-s)/864e5/7+1.5);case"wo":return m=r("w"),m+q(m);case"ww":return k(r("w"),2);case"YY":return k(g%100,2);case"YYYY":return g;case"a":return i>11?"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<f.length;g++)i(f[g],e[g]);return h&&c[3]<12&&(c[3]+=12),n(c)}function q(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 r(a,b){var c,d=/[0-9a-zA-Z]+/g,e=a.match(d),f=[],g=99,h,i,j;for(h=0;h<b.length;h++)i=p(a,b[h]),j=q(e,o(i,b[h]).match(d)),j<g&&(g=j,c=i);return c}function s(a){this._d=a}function t(a,b){return c.relativeTime[a].replace(/%d/i,b||1)}function u(a){var b=Math.abs(a)/1e3,c=b/60,e=c/60,f=e/24,g=f/365;return b<45&&t("s",d(b))||d(c)===1&&t("m")||c<45&&t("mm",d(c))||d(e)===1&&t("h")||e<22&&t("hh",d(e))||d(f)===1&&t("d")||f<=25&&t("dd",d(f))||f<=45&&t("M")||f<345&&t("MM",d(f/30))||d(g)===1&&t("y")||t("yy",d(g))}function v(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|weekdays|weekdaysShort|longDateFormat|relativeTime|ordinal".split("|"),h,i="1.1.0",j="Month|Date|Hours|Minutes|Seconds".split("|");c=function(c,d){var e;return c&&c._d instanceof a?e=c._d:d?m(d)?e=r(c,d):e=p(c,d):e=c===b?new a:c instanceof a?c:m(c)?n(c):new a(c),new s(e)},c.version=i,c.lang=function(a,b){var d,h,i;b&&(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:{L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY h:mm A",LLLL:"dddd, MMMM D YYYY h:mm A"},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=s.prototype={valueOf:function(){return+this._d},"native":function(){return this._d},format:function(a){return o(this._d,a)},add:function(a,b){return this._d=l(this._d,a,1,b),this},subtract:function(a,b){return this._d=l(this._d,a,-1,b),this},diff:function(a,b,e){var f=c(a),g=this._d-f._d,h=this.year()-f.year(),i=this.month()-f.month(),j=this.day()-f.day(),k;return b==="months"?k=h*12+i+j/30:b==="years"?k=h+i/12:k=b==="seconds"?g/1e3:b==="minutes"?g/6e4:b==="hours"?g/36e5:b==="days"?g/864e5:b==="weeks"?g/6048e5:b==="days"?g/3600:g,e?k:d(k)},from:function(a,b){var d=this.diff(a),e=c.relativeTime,f=u(d);return b?f:(d<=0?e.past:e.future).replace(/%s/i,f)},fromNow:function(a){return this.from(c(),a)},isLeapYear:function(){var a=this._d.getFullYear();return a%4===0&&a%100!==0||a%400===0}};for(h=0;h<j.length;h++)v(j[h].toLowerCase(),j[h]);v("year","FullYear"),c.fn.day=function(){return this._d.getDay()},f&&(module.exports=c),typeof window!="undefined"&&(window.moment=c)})(Date)
2  site/js/test.min.js
... ... @@ -1 +1 @@
1   -(function(a){function g(){f.autorun=!0,f.currentModule&&e.moduleDone({name:f.currentModule,failed:f.moduleStats.bad,passed:f.moduleStats.all-f.moduleStats.bad,total:f.moduleStats.all});var a=s("qunit-banner"),b=s("qunit-tests"),c=+(new Date)-f.started,d=f.stats.all-f.stats.bad,g=["Tests completed in ",c," milliseconds.<br/>",'<span class="passed">',d,'</span> tests of <span class="total">',f.stats.all,'</span> passed, <span class="failed">',f.stats.bad,"</span> 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"&amp;";case"\\":return"\\\\";case'"':return'"';case"<":return"&lt;";case">":return"&gt;";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()-b<f.updateRate)f.queue.shift()();else{a.setTimeout(l,13);break}!f.blocking&&!f.queue.length&&g()}function m(){f.pollution=[];if(f.noglobals)for(var b in a)f.pollution.push(b)}function n(a){var b=f.pollution;m();var c=o(b,f.pollution);c.length>0&&(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<c.length;d++)for(var e=0;e<b.length;e++)if(c[d]===b[e]){c.splice(d,1),d--;break}return c}function p(b,c,d){typeof console!="undefined"&&console.error&&console.warn?(console.error(b),console.error(c),console.warn(d.toString())):a.opera&&opera.postError&&opera.postError(b,c,d.toString)}function q(a,b){for(var c in b)a[c]=b[c];return a}function r(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):c()}function s(a){return typeof document!="undefined"&&!!document&&!!document.getElementById&&document.getElementById(a)}function t(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=t(c.childNodes));return b}var b={setTimeout:typeof a.setTimeout!="undefined",sessionStorage:function(){try{return!!sessionStorage.getItem}catch(a){return!1}}()},c=0,d=function(a,b,c,d,e,f){this.name=a,this.testName=b,this.expected=c,this.testEnvironmentArg=d,this.async=e,this.callback=f,this.assertions=[]};d.prototype={init:function(){var a=s("qunit-tests");if(a){var b=document.createElement("strong");b.innerHTML="Running "+this.name;var d=document.createElement("li");d.appendChild(b),d.className="running",d.id=this.id="test-output"+c++,a.appendChild(d)}},setup:function(){this.module!=f.previousModule&&(f.previousModule&&e.moduleDone({name:f.previousModule,failed:f.moduleStats.bad,passed:f.moduleStats.all-f.moduleStats.bad,total:f.moduleStats.all}),f.previousModule=this.module,f.moduleStats={all:0,bad:0},e.moduleStart({name:this.module})),f.current=this,this.testEnvironment=q({setup:function(){},teardown:function(){}},this.moduleTestEnvironment),this.testEnvironmentArg&&q(this.testEnvironment,this.testEnvironmentArg),e.testStart({name:this.testName}),e.current_testEnvironment=this.testEnvironment;try{f.pollution||m(),this.testEnvironment.setup.call(this.testEnvironment)}catch(a){e.ok(!1,"Setup failed on "+this.testName+": "+a.message)}},run:function(){this.async&&e.stop();if(f.notrycatch){this.callback.call(this.testEnvironment);return}try{this.callback.call(this.testEnvironment)}catch(a){p("Test "+this.testName+" died, exception and test follows",a,this.callback),e.ok(!1,"Died on test #"+(this.assertions.length+1)+": "+a.message+" - "+e.jsDump.parse(a)),m(),f.blocking&&start()}},teardown:function(){try{n(),this.testEnvironment.teardown.call(this.testEnvironment)}catch(a){e.ok(!1,"Teardown failed on "+this.testName+": "+a.message)}},finish:function(){this.expected&&this.expected!=this.assertions.length&&e.ok(!1,"Expected "+this.expected+" assertions, but "+this.assertions.length+" were run");var c=0,d=0,g=s("qunit-tests");f.stats.all+=this.assertions.length,f.moduleStats.all+=this.assertions.length;if(g){var h=document.createElement("ol");for(var i=0;i<this.assertions.length;i++){var j=this.assertions[i],k=document.createElement("li");k.className=j.result?"pass":"fail",k.innerHTML=j.message||(j.result?"okay":"failed"),h.appendChild(k),j.result?c++:(d++,f.stats.bad++,f.moduleStats.bad++)}e.config.reorder&&b.sessionStorage&&sessionStorage.setItem("qunit-"+this.testName,d),d==0&&(h.style.display="none");var l=document.createElement("strong");l.innerHTML=this.name+" <b class='counts'>(<b class='failed'>"+d+"</b>, <b class='passed'>"+c+"</b>, "+this.assertions.length+")</b>",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<this.assertions.length;i++)this.assertions[i].result||(d++,f.stats.bad++,f.moduleStats.bad++);try{e.reset()}catch(m){p("reset() failed, following Test "+this.testName+", exception and reset fn follows",m,e.reset)}e.testDone({name:this.testName,failed:d,passed:this.assertions.length-d,total:this.assertions.length})},queue:function(){function c(){k(function(){a.setup()}),k(function(){a.run()}),k(function(){a.teardown()}),k(function(){a.finish()})}var a=this;k(function(){a.init()});var d=e.config.reorder&&b.sessionStorage&&+sessionStorage.getItem("qunit-"+this.testName);d?c():k(c)}};var e={module:function(a,b){f.currentModule=a,f.currentModuleTestEnviroment=b},asyncTest:function(a,b,c){arguments.length===2&&(c=b,b=0),e.test(a,b,c,!0)},test:function(a,b,c,e){var g='<span class="test-name">'+a+"</span>",i;arguments.length===2&&(c=b,b=null),b&&typeof b=="object"&&(i=b,b=null),f.currentModule&&(g='<span class="module-name">'+f.currentModule+"</span>: "+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<c.length;d++)c[d]=decodeURIComponent(c[d]),c[d]==="noglobals"?(c.splice(d,1),d--,f.noglobals=!0):c[d]==="notrycatch"?(c.splice(d,1),d--,f.notrycatch=!0):c[d].search("=")>-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...<br/>&nbsp;")},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='<span class="test-message">'+d+"</span>",c=j(e.jsDump.parse(c)),b=j(e.jsDump.parse(b));var h=d+'<table><tr class="test-expected"><th>Expected: </th><td><pre>'+c+"</pre></td></tr>";b!=c&&(h+='<tr class="test-actual"><th>Result: </th><td><pre>'+b+"</pre></td></tr>",h+='<tr class="test-diff"><th>Diff: </th><td><pre>'+e.diff(c,b)+"</pre></td></tr>");if(!a){var k=i();k&&(g.source=k,h+='<tr class="test-source"><th>Source: </th><td><pre>'+k+"</pre></td></tr>")}h+="</table>",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='<a href=""> '+d.innerHTML+"</a> ";else{var i=decodeURIComponent(location.search.slice(1));d.innerHTML='<a href="'+h+'">'+d.innerHTML+'</a> &#8250; <a href="">'+i+"</a>"}}}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<i;f++){h=!1;for(g=0;g<c.length;g++)c[g]===d[f]&&(h=!0);if(!h&&!a(d[f],b[f]))return c.pop(),!1}return c.pop(),!0},object:function(d,e){var f,g,h,i=!0,j=[],k=[];if(e.constructor!==d.constructor)return!1;b.push(e.constructor),c.push(e);for(f in e){h=!1;for(g=0;g<c.length;g++)c[g]===e[f]&&(h=!0);j.push(f);if(!h&&!a(e[f],d[f])){i=!1;break}}b.pop(),c.pop();for(f in d)k.push(f);return i&&a(j.sort(),k.sort())}}}();return a=function(){var a=Array.prototype.slice.apply(arguments);return a.length<2?!0:function(a,b){return a===b?!0:a===null||b===null||typeof a=="undefined"||typeof b=="undefined"||e.objectType(a)!==e.objectType(b)?!1:d(a,f,[b,a])}(a[0],a[1])&&arguments.callee.apply(this,a.splice(1,a.length-1))},a}(),e.jsDump=function(){function a(a){return'"'+a.toString().replace(/"/g,'\\"')+'"'}function b(a){return a+""}function c(a,b,c){var d=g.separator(),e=g.indent(),f=g.indent(1);return b.join&&(b=b.join(","+d+f)),b?[a,f+b,e+c].join(d):a+c}function d(a){var b=a.length,d=Array(b);this.up();while(b--)d[b]=this.parse(a[b]);return this.down(),c("[",d,"]")}var f=/^function (\w+)/,g={parse:function(a,b){var c=this.parsers[b||this.typeOf(a)];return b=typeof c,b=="function"?c.call(this,a):b=="string"?c:this.parsers.error},typeOf:function(a){var b;return a===null?b="null":typeof a=="undefined"?b="undefined":e.is("RegExp",a)?b="regexp":e.is("Date",a)?b="date":e.is("Function",a)?b="function":typeof a.setInterval!==undefined&&typeof a.document!="undefined"&&typeof a.nodeType=="undefined"?b="window":a.nodeType===9?b="document":a.nodeType?b="node":typeof a=="object"&&typeof a.length=="number"&&a.length>=0?b="array":b=typeof a,b},separator:function(){return this.multiline?this.HTML?"<br />":"\n":this.HTML?"&nbsp;":" "},indent:function(a){if(!this.multiline)return"";var b=this.indentChar;return this.HTML&&(b=b.replace(/\t/g," ").replace(/ /g,"&nbsp;")),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?"&lt;":"<",c=e.jsDump.HTML?"&gt;":">",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;e<b.length;e++)c[b[e]]==null&&(c[b[e]]={rows:new Array,o:null}),c[b[e]].rows.push(e);for(var e=0;e<a.length;e++)d[a[e]]==null&&(d[a[e]]={rows:new Array,n:null}),d[a[e]].rows.push(e);for(var e in c)c[e].rows.length==1&&typeof d[e]!="undefined"&&d[e].rows.length==1&&(b[c[e].rows[0]]={text:b[c[e].rows[0]],row:d[e].rows[0]},a[d[e].rows[0]]={text:a[d[e].rows[0]],row:c[e].rows[0]});for(var e=0;e<b.length-1;e++)b[e].text!=null&&b[e+1].text==null&&b[e].row+1<a.length&&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});for(var e=b.length-1;e>0;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.length;h++)e+="<del>"+d.o[h]+f[h]+"</del>";else{if(d.n[0].text==null)for(c=0;c<d.o.length&&d.o[c].text==null;c++)e+="<del>"+d.o[c]+f[c]+"</del>";for(var h=0;h<d.n.length;h++)if(d.n[h].text==null)e+="<ins>"+d.n[h]+g[h]+"</ins>";else{var i="";for(c=d.n[h].row+1;c<d.o.length&&d.o[c].text==null;c++)i+="<del>"+d.o[c]+f[c]+"</del>";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.length;b++)equal(moment(a[b][1],a[b][0]).format(a[b][0]),a[b][1],a[b][0]+" ---> "+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.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("en");var a="Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("en");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"a few seconds","44 seconds = a few seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"a minute","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"a minute","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutes","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutes","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"an hour","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"an hour","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 hours","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 hours","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 hours","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"a day","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"a day","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 days","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"a day","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 days","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 days","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"a month","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"a month","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"a month","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 months","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 months","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 months","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"a month","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 months","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 months","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"a year","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"a year","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 years","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"a year","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 years","5 years = 5 years")}),test("suffix",2,function(){moment.lang("en"),equal(moment(3e4).from(0),"in a few seconds","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:fr"),test("format",19,function(){moment.lang("fr");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 Fév"],["YYYY YY","2010 10"],["D Do DD","14 14er 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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("fr");var a="Dimanche Dim_Lundi Lun_Mardi Mar_Mercredi Mer_Jeudi Jeu_Vendredi Ven_Samedi Sam".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("fr");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"quelques secondes","44 seconds = a few seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"une minute","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"une minute","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutes","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutes","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"une heure","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"une heure","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 heures","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 heures","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 heures","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"un jour","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"un jour","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 jours","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"un jour","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 jours","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 jours","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"un mois","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"un mois","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"un mois","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 mois","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 mois","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 mois","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"un mois","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 mois","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 mois","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"une année","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"une année","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 années","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"une année","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 années","5 years = 5 years")}),test("suffix",2,function(){moment.lang("fr"),equal(moment(3e4).from(0),"dans quelques secondes","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:it"),test("format",19,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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("it");var a="Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("it");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"secondi","44 seconds = seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"un minuto","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"un minuto","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minuti","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minuti","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"un ora","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"un ora","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 ore","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 ore","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 ore","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"un giorno","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"un giorno","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 giorni","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"un giorno","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 giorni","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 giorni","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"un mese","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"un mese","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"un mese","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 mesi","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 mesi","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 mesi","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"un mese","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 mesi","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 mesi","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"un anno","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"un anno","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 anni","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"un anno","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 anni","5 years = 5 years")}),test("suffix",2,function(){moment.lang("it"),equal(moment(3e4).from(0),"in secondi","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:pt"),test("format",19,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 Feb"],["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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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<a.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("pt");var a="Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("pt");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"segundos","44 seconds = seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"um minuto","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"um minuto","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutos","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutos","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"uma hora","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"uma hora","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 horas","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 horas","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 horas","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"um dia","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"um dia","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 dias","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"um dia","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 dias","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 dias","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"um mês","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"um mês","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"um mês","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 meses","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 meses","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 meses","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"um mês","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 meses","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 meses","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"um ano","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"um ano","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 anos","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"um ano","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 anos","5 years = 5 years")}),test("suffix",2,function(){moment.lang("pt"),equal(moment(3e4).from(0),"em segundos","prefix"),equal(moment(0).from(3e4),"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")})
  1 +(function(a){function g(){f.autorun=!0,f.currentModule&&e.moduleDone({name:f.currentModule,failed:f.moduleStats.bad,passed:f.moduleStats.all-f.moduleStats.bad,total:f.moduleStats.all});var a=s("qunit-banner"),b=s("qunit-tests"),c=+(new Date)-f.started,d=f.stats.all-f.stats.bad,g=["Tests completed in ",c," milliseconds.<br/>",'<span class="passed">',d,'</span> tests of <span class="total">',f.stats.all,'</span> passed, <span class="failed">',f.stats.bad,"</span> 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"&amp;";case"\\":return"\\\\";case'"':return'"';case"<":return"&lt;";case">":return"&gt;";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()-b<f.updateRate)f.queue.shift()();else{a.setTimeout(l,13);break}!f.blocking&&!f.queue.length&&g()}function m(){f.pollution=[];if(f.noglobals)for(var b in a)f.pollution.push(b)}function n(a){var b=f.pollution;m();var c=o(b,f.pollution);c.length>0&&(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<c.length;d++)for(var e=0;e<b.length;e++)if(c[d]===b[e]){c.splice(d,1),d--;break}return c}function p(b,c,d){typeof console!="undefined"&&console.error&&console.warn?(console.error(b),console.error(c),console.warn(d.toString())):a.opera&&opera.postError&&opera.postError(b,c,d.toString)}function q(a,b){for(var c in b)a[c]=b[c];return a}function r(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):c()}function s(a){return typeof document!="undefined"&&!!document&&!!document.getElementById&&document.getElementById(a)}function t(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=t(c.childNodes));return b}var b={setTimeout:typeof a.setTimeout!="undefined",sessionStorage:function(){try{return!!sessionStorage.getItem}catch(a){return!1}}()},c=0,d=function(a,b,c,d,e,f){this.name=a,this.testName=b,this.expected=c,this.testEnvironmentArg=d,this.async=e,this.callback=f,this.assertions=[]};d.prototype={init:function(){var a=s("qunit-tests");if(a){var b=document.createElement("strong");b.innerHTML="Running "+this.name;var d=document.createElement("li");d.appendChild(b),d.className="running",d.id=this.id="test-output"+c++,a.appendChild(d)}},setup:function(){this.module!=f.previousModule&&(f.previousModule&&e.moduleDone({name:f.previousModule,failed:f.moduleStats.bad,passed:f.moduleStats.all-f.moduleStats.bad,total:f.moduleStats.all}),f.previousModule=this.module,f.moduleStats={all:0,bad:0},e.moduleStart({name:this.module})),f.current=this,this.testEnvironment=q({setup:function(){},teardown:function(){}},this.moduleTestEnvironment),this.testEnvironmentArg&&q(this.testEnvironment,this.testEnvironmentArg),e.testStart({name:this.testName}),e.current_testEnvironment=this.testEnvironment;try{f.pollution||m(),this.testEnvironment.setup.call(this.testEnvironment)}catch(a){e.ok(!1,"Setup failed on "+this.testName+": "+a.message)}},run:function(){this.async&&e.stop();if(f.notrycatch){this.callback.call(this.testEnvironment);return}try{this.callback.call(this.testEnvironment)}catch(a){p("Test "+this.testName+" died, exception and test follows",a,this.callback),e.ok(!1,"Died on test #"+(this.assertions.length+1)+": "+a.message+" - "+e.jsDump.parse(a)),m(),f.blocking&&start()}},teardown:function(){try{n(),this.testEnvironment.teardown.call(this.testEnvironment)}catch(a){e.ok(!1,"Teardown failed on "+this.testName+": "+a.message)}},finish:function(){this.expected&&this.expected!=this.assertions.length&&e.ok(!1,"Expected "+this.expected+" assertions, but "+this.assertions.length+" were run");var c=0,d=0,g=s("qunit-tests");f.stats.all+=this.assertions.length,f.moduleStats.all+=this.assertions.length;if(g){var h=document.createElement("ol");for(var i=0;i<this.assertions.length;i++){var j=this.assertions[i],k=document.createElement("li");k.className=j.result?"pass":"fail",k.innerHTML=j.message||(j.result?"okay":"failed"),h.appendChild(k),j.result?c++:(d++,f.stats.bad++,f.moduleStats.bad++)}e.config.reorder&&b.sessionStorage&&sessionStorage.setItem("qunit-"+this.testName,d),d==0&&(h.style.display="none");var l=document.createElement("strong");l.innerHTML=this.name+" <b class='counts'>(<b class='failed'>"+d+"</b>, <b class='passed'>"+c+"</b>, "+this.assertions.length+")</b>",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<this.assertions.length;i++)this.assertions[i].result||(d++,f.stats.bad++,f.moduleStats.bad++);try{e.reset()}catch(m){p("reset() failed, following Test "+this.testName+", exception and reset fn follows",m,e.reset)}e.testDone({name:this.testName,failed:d,passed:this.assertions.length-d,total:this.assertions.length})},queue:function(){function c(){k(function(){a.setup()}),k(function(){a.run()}),k(function(){a.teardown()}),k(function(){a.finish()})}var a=this;k(function(){a.init()});var d=e.config.reorder&&b.sessionStorage&&+sessionStorage.getItem("qunit-"+this.testName);d?c():k(c)}};var e={module:function(a,b){f.currentModule=a,f.currentModuleTestEnviroment=b},asyncTest:function(a,b,c){arguments.length===2&&(c=b,b=0),e.test(a,b,c,!0)},test:function(a,b,c,e){var g='<span class="test-name">'+a+"</span>",i;arguments.length===2&&(c=b,b=null),b&&typeof b=="object"&&(i=b,b=null),f.currentModule&&(g='<span class="module-name">'+f.currentModule+"</span>: "+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<c.length;d++)c[d]=decodeURIComponent(c[d]),c[d]==="noglobals"?(c.splice(d,1),d--,f.noglobals=!0):c[d]==="notrycatch"?(c.splice(d,1),d--,f.notrycatch=!0):c[d].search("=")>-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...<br/>&nbsp;")},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='<span class="test-message">'+d+"</span>",c=j(e.jsDump.parse(c)),b=j(e.jsDump.parse(b));var h=d+'<table><tr class="test-expected"><th>Expected: </th><td><pre>'+c+"</pre></td></tr>";b!=c&&(h+='<tr class="test-actual"><th>Result: </th><td><pre>'+b+"</pre></td></tr>",h+='<tr class="test-diff"><th>Diff: </th><td><pre>'+e.diff(c,b)+"</pre></td></tr>");if(!a){var k=i();k&&(g.source=k,h+='<tr class="test-source"><th>Source: </th><td><pre>'+k+"</pre></td></tr>")}h+="</table>",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='<a href=""> '+d.innerHTML+"</a> ";else{var i=decodeURIComponent(location.search.slice(1));d.innerHTML='<a href="'+h+'">'+d.innerHTML+'</a> &#8250; <a href="">'+i+"</a>"}}}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<i;f++){h=!1;for(g=0;g<c.length;g++)c[g]===d[f]&&(h=!0);if(!h&&!a(d[f],b[f]))return c.pop(),!1}return c.pop(),!0},object:function(d,e){var f,g,h,i=!0,j=[],k=[];if(e.constructor!==d.constructor)return!1;b.push(e.constructor),c.push(e);for(f in e){h=!1;for(g=0;g<c.length;g++)c[g]===e[f]&&(h=!0);j.push(f);if(!h&&!a(e[f],d[f])){i=!1;break}}b.pop(),c.pop();for(f in d)k.push(f);return i&&a(j.sort(),k.sort())}}}();return a=function(){var a=Array.prototype.slice.apply(arguments);return a.length<2?!0:function(a,b){return a===b?!0:a===null||b===null||typeof a=="undefined"||typeof b=="undefined"||e.objectType(a)!==e.objectType(b)?!1:d(a,f,[b,a])}(a[0],a[1])&&arguments.callee.apply(this,a.splice(1,a.length-1))},a}(),e.jsDump=function(){function a(a){return'"'+a.toString().replace(/"/g,'\\"')+'"'}function b(a){return a+""}function c(a,b,c){var d=g.separator(),e=g.indent(),f=g.indent(1);return b.join&&(b=b.join(","+d+f)),b?[a,f+b,e+c].join(d):a+c}function d(a){var b=a.length,d=Array(b);this.up();while(b--)d[b]=this.parse(a[b]);return this.down(),c("[",d,"]")}var f=/^function (\w+)/,g={parse:function(a,b){var c=this.parsers[b||this.typeOf(a)];return b=typeof c,b=="function"?c.call(this,a):b=="string"?c:this.parsers.error},typeOf:function(a){var b;return a===null?b="null":typeof a=="undefined"?b="undefined":e.is("RegExp",a)?b="regexp":e.is("Date",a)?b="date":e.is("Function",a)?b="function":typeof a.setInterval!==undefined&&typeof a.document!="undefined"&&typeof a.nodeType=="undefined"?b="window":a.nodeType===9?b="document":a.nodeType?b="node":typeof a=="object"&&typeof a.length=="number"&&a.length>=0?b="array":b=typeof a,b},separator:function(){return this.multiline?this.HTML?"<br />":"\n":this.HTML?"&nbsp;":" "},indent:function(a){if(!this.multiline)return"";var b=this.indentChar;return this.HTML&&(b=b.replace(/\t/g," ").replace(/ /g,"&nbsp;")),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?"&lt;":"<",c=e.jsDump.HTML?"&gt;":">",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;e<b.length;e++)c[b[e]]==null&&(c[b[e]]={rows:new Array,o:null}),c[b[e]].rows.push(e);for(var e=0;e<a.length;e++)d[a[e]]==null&&(d[a[e]]={rows:new Array,n:null}),d[a[e]].rows.push(e);for(var e in c)c[e].rows.length==1&&typeof d[e]!="undefined"&&d[e].rows.length==1&&(b[c[e].rows[0]]={text:b[c[e].rows[0]],row:d[e].rows[0]},a[d[e].rows[0]]={text:a[d[e].rows[0]],row:c[e].rows[0]});for(var e=0;e<b.length-1;e++)b[e].text!=null&&b[e+1].text==null&&b[e].row+1<a.length&&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});for(var e=b.length-1;e>0;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.length;h++)e+="<del>"+d.o[h]+f[h]+"</del>";else{if(d.n[0].text==null)for(c=0;c<d.o.length&&d.o[c].text==null;c++)e+="<del>"+d.o[c]+f[c]+"</del>";for(var h=0;h<d.n.length;h++)if(d.n[h].text==null)e+="<ins>"+d.n[h]+g[h]+"</ins>";else{var i="";for(c=d.n[h].row+1;c<d.o.length&&d.o[c].text==null;c++)i+="<del>"+d.o[c]+f[c]+"</del>";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.length;b++)equal(moment(a[b][1],a[b][0]).format(a[b][0]),a[b][1],a[b][0]+" ---> "+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")}),test("YY format",function(){var a=moment();a.year(2009),equal(a.format("YY"),"09","zero-filled year")});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.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("en");var a="Sunday Sun_Monday Mon_Tuesday Tue_Wednesday Wed_Thursday Thu_Friday Fri_Saturday Sat".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("en");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"a few seconds","44 seconds = a few seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"a minute","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"a minute","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutes","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutes","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"an hour","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"an hour","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 hours","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 hours","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 hours","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"a day","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"a day","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 days","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"a day","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 days","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 days","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"a month","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"a month","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"a month","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 months","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 months","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 months","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"a month","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 months","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 months","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"a year","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"a year","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 years","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"a year","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 years","5 years = 5 years")}),test("suffix",2,function(){moment.lang("en"),equal(moment(3e4).from(0),"in a few seconds","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:fr"),test("format",19,function(){moment.lang("fr");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 Fév"],["YYYY YY","2010 10"],["D Do DD","14 14er 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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("fr");var a="Dimanche Dim_Lundi Lun_Mardi Mar_Mercredi Mer_Jeudi Jeu_Vendredi Ven_Samedi Sam".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("fr");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"quelques secondes","44 seconds = a few seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"une minute","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"une minute","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutes","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutes","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"une heure","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"une heure","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 heures","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 heures","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 heures","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"un jour","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"un jour","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 jours","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"un jour","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 jours","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 jours","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"un mois","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"un mois","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"un mois","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 mois","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 mois","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 mois","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"un mois","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 mois","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 mois","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"une année","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"une année","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 années","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"une année","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 années","5 years = 5 years")}),test("suffix",2,function(){moment.lang("fr"),equal(moment(3e4).from(0),"dans quelques secondes","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:it"),test("format",19,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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("it");var a="Domenica Dom_Lunedi Lun_Martedi Mar_Mercoledi Mer_Giovedi Gio_Venerdi Ven_Sabato Sab".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("it");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"secondi","44 seconds = seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"un minuto","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"un minuto","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minuti","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minuti","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"un ora","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"un ora","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 ore","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 ore","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 ore","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"un giorno","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"un giorno","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 giorni","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"un giorno","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 giorni","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 giorni","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"un mese","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"un mese","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"un mese","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 mesi","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 mesi","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 mesi","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"un mese","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 mesi","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 mesi","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"un anno","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"un anno","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 anni","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"un anno","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 anni","5 years = 5 years")}),test("suffix",2,function(){moment.lang("it"),equal(moment(3e4).from(0),"in secondi","prefix"),equal(moment(0).from(3e4),"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")}),module("lang:pt"),test("format",19,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 Feb"],["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"],["z zz","PST PST"],["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)),c;for(c=0;c<a.length;c++)equal(b.format(a[c][0]),a[c][1],a[c][0]+" ---> "+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<a.length;b++)equal(moment([2011,b,0]).format("MMMM MMM"),a[b],a[b])}),test("format week",7,function(){moment.lang("pt");var a="Domingo Dom_Segunda-feira Seg_Terça-feira Ter_Quarta-feira Qua_Quinta-feira Qui_Sexta-feira Sex_Sábado Sáb".split("_"),b;for(b=0;b<a.length;b++)equal(moment([2011,0,2+b]).format("dddd ddd"),a[b],a[b])}),test("from",30,function(){moment.lang("pt");var a=moment([2007,1,28]);equal(a.from(moment([2007,1,28]).add({s:44}),!0),"segundos","44 seconds = seconds"),equal(a.from(moment([2007,1,28]).add({s:45}),!0),"um minuto","45 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:89}),!0),"um minuto","89 seconds = a minute"),equal(a.from(moment([2007,1,28]).add({s:90}),!0),"2 minutos","90 seconds = 2 minutes"),equal(a.from(moment([2007,1,28]).add({m:44}),!0),"44 minutos","44 minutes = 44 minutes"),equal(a.from(moment([2007,1,28]).add({m:45}),!0),"uma hora","45 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:89}),!0),"uma hora","89 minutes = an hour"),equal(a.from(moment([2007,1,28]).add({m:90}),!0),"2 horas","90 minutes = 2 hours"),equal(a.from(moment([2007,1,28]).add({h:5}),!0),"5 horas","5 hours = 5 hours"),equal(a.from(moment([2007,1,28]).add({h:21}),!0),"21 horas","21 hours = 21 hours"),equal(a.from(moment([2007,1,28]).add({h:22}),!0),"um dia","22 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:35}),!0),"um dia","35 hours = a day"),equal(a.from(moment([2007,1,28]).add({h:36}),!0),"2 dias","36 hours = 2 days"),equal(a.from(moment([2007,1,28]).add({d:1}),!0),"um dia","1 day = a day"),equal(a.from(moment([2007,1,28]).add({d:5}),!0),"5 dias","5 days = 5 days"),equal(a.from(moment([2007,1,28]).add({d:25}),!0),"25 dias","25 days = 25 days"),equal(a.from(moment([2007,1,28]).add({d:26}),!0),"um mês","26 days = a month"),equal(a.from(moment([2007,1,28]).add({d:30}),!0),"um mês","30 days = a month"),equal(a.from(moment([2007,1,28]).add({d:45}),!0),"um mês","45 days = a month"),equal(a.from(moment([2007,1,28]).add({d:46}),!0),"2 meses","46 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:74}),!0),"2 meses","75 days = 2 months"),equal(a.from(moment([2007,1,28]).add({d:76}),!0),"3 meses","76 days = 3 months"),equal(a.from(moment([2007,1,28]).add({M:1}),!0),"um mês","1 month = a month"),equal(a.from(moment([2007,1,28]).add({M:5}),!0),"5 meses","5 months = 5 months"),equal(a.from(moment([2007,1,28]).add({d:344}),!0),"11 meses","344 days = 11 months"),equal(a.from(moment([2007,1,28]).add({d:345}),!0),"um ano","345 days = a year"),equal(a.from(moment([2007,1,28]).add({d:547}),!0),"um ano","547 days = a year"),equal(a.from(moment([2007,1,28]).add({d:548}),!0),"2 anos","548 days = 2 years"),equal(a.from(moment([2007,1,28]).add({y:1}),!0),"um ano","1 year = a year"),equal(a.from(moment([2007,1,28]).add({y:5}),!0),"5 anos","5 years = 5 years")}),test("suffix",2,function(){moment.lang("pt"),equal(moment(3e4).from(0),"em segundos","prefix"),equal(moment(0).from(3e4),"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")})
6 sitesrc/js/unit-tests.js
@@ -287,3 +287,9 @@ test("chaining setters", 7, function() {
287 287 equal(a.seconds(), 8, 'second');
288 288 });
289 289
  290 +test("YY format", function() {
  291 + var a = moment();
  292 + a.year(2009);
  293 + equal(a.format('YY'), '09', 'zero-filled year');
  294 +});
  295 +

0 comments on commit ca2da02

Please sign in to comment.
Something went wrong with that request. Please try again.