usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [54/71] [abbrv] updating portal with latest code base
Date Thu, 20 Feb 2014 16:21:42 GMT
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a5a98884/portal/archive/js/lib/date.min.js
----------------------------------------------------------------------
diff --git a/portal/archive/js/lib/date.min.js b/portal/archive/js/lib/date.min.js
new file mode 100644
index 0000000..261327a
--- /dev/null
+++ b/portal/archive/js/lib/date.min.js
@@ -0,0 +1,2 @@
+Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English
(United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd,
MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy
h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd,
dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"
 },regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p
 )/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};(function(){var
a=Date,b=a.prototype,c=a.CultureInfo,d=function(a,b){if(!b){b=2}return("000"+a).slice(b*-1)};b.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return
this};b.setTimeToNow=function(){var a=new Date;this.setHours(a.getHours());this.setMinutes(a.getMinutes());this.setSeconds(a.getSeconds());this.setMilliseconds(a.getMilliseconds());return
this};a.today=function(){return(new Date).clearTime()};a.compare=function(a,b){if(isNaN(a)||isNaN(b)){throw
new Error(a+" - "+b)}else if(a instanceof Date&&b instanceof Date){return a<b?-1:a>b?1:0}else{throw
new TypeError(a+" - "+b)}};a.equals=function(a,b){return a.compareTo(b)===0};a.getDayNu
 mberFromName=function(a){var b=c.dayNames,d=c.abbreviatedDayNames,e=c.shortestDayNames,f=a.toLowerCase();for(var
g=0;g<b.length;g++){if(b[g].toLowerCase()==f||d[g].toLowerCase()==f||e[g].toLowerCase()==f){return
g}}return-1};a.getMonthNumberFromName=function(a){var b=c.monthNames,d=c.abbreviatedMonthNames,e=a.toLowerCase();for(var
f=0;f<b.length;f++){if(b[f].toLowerCase()==e||d[f].toLowerCase()==e){return f}}return-1};a.isLeapYear=function(a){return
a%4===0&&a%100!==0||a%400===0};a.getDaysInMonth=function(b,c){return[31,a.isLeapYear(b)?29:28,31,30,31,30,31,31,30,31,30,31][c]};a.getTimezoneAbbreviation=function(a){var
b=c.timezones,d;for(var e=0;e<b.length;e++){if(b[e].offset===a){return b[e].name}}return
null};a.getTimezoneOffset=function(a){var b=c.timezones,d;for(var e=0;e<b.length;e++){if(b[e].name===a.toUpperCase()){return
b[e].offset}}return null};b.clone=function(){return new Date(this.getTime())};b.compareTo=function(a){return
Date.compare(this,a)};b.equals=function(a){return
  Date.equals(this,a||new Date)};b.between=function(a,b){return this.getTime()>=a.getTime()&&this.getTime()<=b.getTime()};b.isAfter=function(a){return
this.compareTo(a||new Date)===1};b.isBefore=function(a){return this.compareTo(a||new Date)===-1};b.isToday=function(){return
this.isSameDay(new Date)};b.isSameDay=function(a){return this.clone().clearTime().equals(a.clone().clearTime())};b.addMilliseconds=function(a){this.setMilliseconds(this.getMilliseconds()+a);return
this};b.addSeconds=function(a){return this.addMilliseconds(a*1e3)};b.addMinutes=function(a){return
this.addMilliseconds(a*6e4)};b.addHours=function(a){return this.addMilliseconds(a*36e5)};b.addDays=function(a){this.setDate(this.getDate()+a);return
this};b.addWeeks=function(a){return this.addDays(a*7)};b.addMonths=function(b){var c=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+b);this.setDate(Math.min(c,a.getDaysInMonth(this.getFullYear(),this.getMonth())));return
this};b.addYears=function(a){return this.a
 ddMonths(a*12)};b.add=function(a){if(typeof a=="number"){this._orient=a;return this}var b=a;if(b.milliseconds){this.addMilliseconds(b.milliseconds)}if(b.seconds){this.addSeconds(b.seconds)}if(b.minutes){this.addMinutes(b.minutes)}if(b.hours){this.addHours(b.hours)}if(b.weeks){this.addWeeks(b.weeks)}if(b.months){this.addMonths(b.months)}if(b.years){this.addYears(b.years)}if(b.days){this.addDays(b.days)}return
this};var e,f,g;b.getWeek=function(){var a,b,c,d,h,i,j,k,l,m;e=!e?this.getFullYear():e;f=!f?this.getMonth()+1:f;g=!g?this.getDate():g;if(f<=2){a=e-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);l=b-c;h=0;i=g-1+31*(f-1)}else{a=e;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);l=b-c;h=l+1;i=g+(153*(f-3)+2)/5+58+l}j=(a+b)%7;d=(i+j-h)%7;k=i+3-d|0;if(k<0){m=53-((j-l)/5|0)}else
if(k>364+l){m=1}else{m=(k/7|0)+1}e=f=g=null;return m};b.getISOWeek=function(){e=this.getUTCFullYear();f=this.getUTCMonth()+1;g=this.getUTCDate();return
d(this.
 getWeek())};b.setWeek=function(a){return this.moveToDayOfWeek(1).addWeeks(a-this.getWeek())};a._validate=function(a,b,c,d){if(typeof
a=="undefined"){return false}else if(typeof a!="number"){throw new TypeError(a+" is not a
Number.")}else if(a<b||a>c){throw new RangeError(a+" is not a valid value for "+d+".")}return
true};a.validateMillisecond=function(b){return a._validate(b,0,999,"millisecond")};a.validateSecond=function(b){return
a._validate(b,0,59,"second")};a.validateMinute=function(b){return a._validate(b,0,59,"minute")};a.validateHour=function(b){return
a._validate(b,0,23,"hour")};a.validateDay=function(b,c,d){return a._validate(b,1,a.getDaysInMonth(c,d),"day")};a.validateMonth=function(b){return
a._validate(b,0,11,"month")};a.validateYear=function(b){return a._validate(b,0,9999,"year")};b.set=function(b){if(a.validateMillisecond(b.millisecond)){this.addMilliseconds(b.millisecond-this.getMilliseconds())}if(a.validateSecond(b.second)){this.addSeconds(b.second-this.getSeconds())
 }if(a.validateMinute(b.minute)){this.addMinutes(b.minute-this.getMinutes())}if(a.validateHour(b.hour)){this.addHours(b.hour-this.getHours())}if(a.validateMonth(b.month)){this.addMonths(b.month-this.getMonth())}if(a.validateYear(b.year)){this.addYears(b.year-this.getFullYear())}if(a.validateDay(b.day,this.getFullYear(),this.getMonth())){this.addDays(b.day-this.getDate())}if(b.timezone){this.setTimezone(b.timezone)}if(b.timezoneOffset){this.setTimezoneOffset(b.timezoneOffset)}if(b.week&&a._validate(b.week,0,53,"week")){this.setWeek(b.week)}return
this};b.moveToFirstDayOfMonth=function(){return this.set({day:1})};b.moveToLastDayOfMonth=function(){return
this.set({day:a.getDaysInMonth(this.getFullYear(),this.getMonth())})};b.moveToNthOccurrence=function(a,b){var
c=0;if(b>0){c=b-1}else if(b===-1){this.moveToLastDayOfMonth();if(this.getDay()!==a){this.moveToDayOfWeek(a,-1)}return
this}return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(a,+1).addWeeks(c)};b.moveToDayOfWeek=func
 tion(a,b){var c=(a-this.getDay()+7*(b||+1))%7;return this.addDays(c===0?c+=7*(b||+1):c)};b.moveToMonth=function(a,b){var
c=(a-this.getMonth()+12*(b||+1))%12;return this.addMonths(c===0?c+=12*(b||+1):c)};b.getOrdinalNumber=function(){return
Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/864e5)+1};b.getTimezone=function(){return
a.getTimezoneAbbreviation(this.getUTCOffset())};b.setTimezoneOffset=function(a){var b=this.getTimezoneOffset(),c=Number(a)*-6/10;return
this.addMinutes(c-b)};b.setTimezone=function(b){return this.setTimezoneOffset(a.getTimezoneOffset(b))};b.hasDaylightSavingTime=function(){return
Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset()};b.isDaylightSavingTime=function(){return
this.hasDaylightSavingTime()&&(new Date).getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset()};b.getUTCOffset=function(){var
a=this.getTimezoneOffset()*-10/6,b;if(a<0){b=(a-1e4).toString();
 return b.charAt(0)+b.substr(2)}else{b=(a+1e4).toString();return"+"+b.substr(1)}};b.getElapsed=function(a){return(a||new
Date)-this};if(!b.toISOString){b.toISOString=function(){function a(a){return a<10?"0"+a:a}return'"'+this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+'Z"'}}b._toString=b.toString;b.toString=function(a){var
b=this;if(a&&a.length==1){var e=c.formatPatterns;b.t=b.toString;switch(a){case"d":return
b.t(e.shortDate);case"D":return b.t(e.longDate);case"F":return b.t(e.fullDateTime);case"m":return
b.t(e.monthDay);case"r":return b.t(e.rfc1123);case"s":return b.t(e.sortableDateTime);case"t":return
b.t(e.shortTime);case"T":return b.t(e.longTime);case"u":return b.t(e.universalSortableDateTime);case"y":return
b.t(e.yearMonth)}}var f=function(a){switch(a*1){case 1:case 21:case 31:return"st";case 2:case
22:return"nd";case 3:case 23:return"rd";default:return"th"}};return a?a.
 replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(a){if(a.charAt(0)==="\\"){return
a.replace("\\","")}b.h=b.getHours;switch(a){case"hh":return d(b.h()<13?b.h()===0?12:b.h():b.h()-12);case"h":return
b.h()<13?b.h()===0?12:b.h():b.h()-12;case"HH":return d(b.h());case"H":return b.h();case"mm":return
d(b.getMinutes());case"m":return b.getMinutes();case"ss":return d(b.getSeconds());case"s":return
b.getSeconds();case"yyyy":return d(b.getFullYear(),4);case"yy":return d(b.getFullYear());case"dddd":return
c.dayNames[b.getDay()];case"ddd":return c.abbreviatedDayNames[b.getDay()];case"dd":return
d(b.getDate());case"d":return b.getDate();case"MMMM":return c.monthNames[b.getMonth()];case"MMM":return
c.abbreviatedMonthNames[b.getMonth()];case"MM":return d(b.getMonth()+1);case"M":return b.getMonth()+1;case"t":return
b.h()<12?c.amDesignator.substring(0,1):c.pmDesignator.substring(0,1);case"tt":return b.h()<12?c.amDesignator:c.pmDesignator;case"S":return
f(b.getDate());default:
 return a}}):this._toString()}})();(function(){var a=Date,b=a.prototype,c=a.CultureInfo,d=Number.prototype;b._orient=+1;b._nth=null;b._is=false;b._same=false;b._isSecond=false;d._dateElement="day";b.next=function(){this._orient=+1;return
this};a.next=function(){return a.today().next()};b.last=b.prev=b.previous=function(){this._orient=-1;return
this};a.last=a.prev=a.previous=function(){return a.today().last()};b.is=function(){this._is=true;return
this};b.same=function(){this._same=true;this._isSecond=false;return this};b.today=function(){return
this.same().day()};b.weekday=function(){if(this._is){this._is=false;return!this.is().sat()&&!this.is().sun()}return
false};b.at=function(b){return typeof b==="string"?a.parse(this.toString("d")+" "+b):this.set(b)};d.fromNow=d.after=function(a){var
b={};b[this._dateElement]=this;return(!a?new Date:a.clone()).add(b)};d.ago=d.before=function(a){var
b={};b[this._dateElement]=this*-1;return(!a?new Date:a.clone()).add(b)};var e="sunday monday
tuesday
  wednesday thursday friday saturday".split(/\s/),f="january february march april may june
july august september october november december".split(/\s/),g="Millisecond Second Minute
Hour Day Week Month Year".split(/\s/),h="Milliseconds Seconds Minutes Hours Date Week Month
FullYear".split(/\s/),i="final first second third fourth fifth".split(/\s/),j;b.toObject=function(){var
a={};for(var b=0;b<g.length;b++){a[g[b].toLowerCase()]=this["get"+h[b]]()}return a};a.fromObject=function(a){a.week=null;return
Date.today().set(a)};var k=function(b){return function(){if(this._is){this._is=false;return
this.getDay()==b}if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1)}this._isSecond=false;var
c=this._nth;this._nth=null;var d=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(b,c);if(this>d){throw
new RangeError(a.getDayName(b)+" does not occur "+c+" times in the month of "+a.getMonthName(d.getMonth())+"
"+d.getFullYear()+".")}return this}return this.moveToDayOfWee
 k(b,this._orient)}};var l=function(b){return function(){var d=a.today(),e=b-d.getDay();if(b===0&&c.firstDayOfWeek===1&&d.getDay()!==0){e=e+7}return
d.addDays(e)}};for(var m=0;m<e.length;m++){a[e[m].toUpperCase()]=a[e[m].toUpperCase().substring(0,3)]=m;a[e[m]]=a[e[m].substring(0,3)]=l(m);b[e[m]]=b[e[m].substring(0,3)]=k(m)}var
n=function(a){return function(){if(this._is){this._is=false;return this.getMonth()===a}return
this.moveToMonth(a,this._orient)}};var o=function(b){return function(){return a.today().set({month:b,day:1})}};for(var
p=0;p<f.length;p++){a[f[p].toUpperCase()]=a[f[p].toUpperCase().substring(0,3)]=p;a[f[p]]=a[f[p].substring(0,3)]=o(p);b[f[p]]=b[f[p].substring(0,3)]=n(p)}var
q=function(a){return function(){if(this._isSecond){this._isSecond=false;return this}if(this._same){this._same=this._is=false;var
b=this.toObject(),c=(arguments[0]||new Date).toObject(),d="",e=a.toLowerCase();for(var f=g.length-1;f>-1;f--){d=g[f].toLowerCase();if(b[d]!=c[d]){return
false}if(e==d){br
 eak}}return true}if(a.substring(a.length-1)!="s"){a+="s"}return this["add"+a](this._orient)}};var
r=function(a){return function(){this._dateElement=a;return this}};for(var s=0;s<g.length;s++){j=g[s].toLowerCase();b[j]=b[j+"s"]=q(g[s]);d[j]=d[j+"s"]=r(j)}b._ss=q("Second");var
t=function(a){return function(b){if(this._same){return this._ss(arguments[0])}if(b||b===0){return
this.moveToNthOccurrence(b,a)}this._nth=a;if(a===2&&(b===undefined||b===null)){this._isSecond=true;return
this.addSeconds(this._orient)}return this}};for(var u=0;u<i.length;u++){b[i[u]]=u===0?t(-1):t(u)}})();(function(){Date.Parsing={Exception:function(a){this.message="Parse
error at '"+a.substring(0,10)+" ...'"}};var a=Date.Parsing;var b=a.Operators={rtoken:function(b){return
function(c){var d=c.match(b);if(d){return[d[0],c.substring(d[0].length)]}else{throw new a.Exception(c)}}},token:function(a){return
function(a){return b.rtoken(new RegExp("^s*"+a+"s*"))(a)}},stoken:function(a){return b.rtoken(new
RegExp("^"+a))
 },until:function(a){return function(b){var c=[],d=null;while(b.length){try{d=a.call(this,b)}catch(e){c.push(d[0]);b=d[1];continue}break}return[c,b]}},many:function(a){return
function(b){var c=[],d=null;while(b.length){try{d=a.call(this,b)}catch(e){return[c,b]}c.push(d[0]);b=d[1]}return[c,b]}},optional:function(a){return
function(b){var c=null;try{c=a.call(this,b)}catch(d){return[null,b]}return[c[0],c[1]]}},not:function(b){return
function(c){try{b.call(this,c)}catch(d){return[null,c]}throw new a.Exception(c)}},ignore:function(a){return
a?function(b){var c=null;c=a.call(this,b);return[null,c[1]]}:null},product:function(){var
a=arguments[0],c=Array.prototype.slice.call(arguments,1),d=[];for(var e=0;e<a.length;e++){d.push(b.each(a[e],c))}return
d},cache:function(b){var c={},d=null;return function(e){try{d=c[e]=c[e]||b.call(this,e)}catch(f){d=c[e]=f}if(d
instanceof a.Exception){throw d}else{return d}}},any:function(){var b=arguments;return function(c){var
d=null;for(var e=0;e<b.length;e+
 +){if(b[e]==null){continue}try{d=b[e].call(this,c)}catch(f){d=null}if(d){return d}}throw
new a.Exception(c)}},each:function(){var b=arguments;return function(c){var d=[],e=null;for(var
f=0;f<b.length;f++){if(b[f]==null){continue}try{e=b[f].call(this,c)}catch(g){throw new
a.Exception(c)}d.push(e[0]);c=e[1]}return[d,c]}},all:function(){var a=arguments,b=b;return
b.each(b.optional(a))},sequence:function(c,d,e){d=d||b.rtoken(/^\s*/);e=e||null;if(c.length==1){return
c[0]}return function(b){var f=null,g=null;var h=[];for(var i=0;i<c.length;i++){try{f=c[i].call(this,b)}catch(j){break}h.push(f[0]);try{g=d.call(this,f[1])}catch(k){g=null;break}b=g[1]}if(!f){throw
new a.Exception(b)}if(g){throw new a.Exception(g[1])}if(e){try{f=e.call(this,f[1])}catch(l){throw
new a.Exception(f[1])}}return[h,f?f[1]:b]}},between:function(a,c,d){d=d||a;var e=b.each(b.ignore(a),c,b.ignore(d));return
function(a){var b=e.call(this,a);return[[b[0][0],r[0][2]],b[1]]}},list:function(a,c,d){c=c||b.rtoken(/^\s*/);d=d||
 null;return a instanceof Array?b.each(b.product(a.slice(0,-1),b.ignore(c)),a.slice(-1),b.ignore(d)):b.each(b.many(b.each(a,b.ignore(c))),px,b.ignore(d))},set:function(c,d,e){d=d||b.rtoken(/^\s*/);e=e||null;return
function(f){var g=null,h=null,i=null,j=null,k=[[],f],l=false;for(var m=0;m<c.length;m++){i=null;h=null;g=null;l=c.length==1;try{g=c[m].call(this,f)}catch(n){continue}j=[[g[0]],g[1]];if(g[1].length>0&&!l){try{i=d.call(this,g[1])}catch(o){l=true}}else{l=true}if(!l&&i[1].length===0){l=true}if(!l){var
p=[];for(var q=0;q<c.length;q++){if(m!=q){p.push(c[q])}}h=b.set(p,d).call(this,i[1]);if(h[0].length>0){j[0]=j[0].concat(h[0]);j[1]=h[1]}}if(j[1].length<k[1].length){k=j}if(k[1].length===0){break}}if(k[0].length===0){return
k}if(e){try{i=e.call(this,k[1])}catch(r){throw new a.Exception(k[1])}k[1]=i[1]}return k}},forward:function(a,b){return
function(c){return a[b].call(this,c)}},replace:function(a,b){return function(c){var d=a.call(this,c);return[b,d[1]]}},process:function(a,b){ret
 urn function(c){var d=a.call(this,c);return[b.call(this,d[0]),d[1]]}},min:function(b,c){return
function(d){var e=c.call(this,d);if(e[0].length<b){throw new a.Exception(d)}return e}}};var
c=function(a){return function(){var b=null,c=[];if(arguments.length>1){b=Array.prototype.slice.call(arguments)}else
if(arguments[0]instanceof Array){b=arguments[0]}if(b){for(var d=0,e=b.shift();d<e.length;d++){b.unshift(e[d]);c.push(a.apply(null,b));b.shift();return
c}}else{return a.apply(null,arguments)}}};var d="optional not ignore cache".split(/\s/);for(var
e=0;e<d.length;e++){b[d[e]]=c(b[d[e]])}var f=function(a){return function(){if(arguments[0]instanceof
Array){return a.apply(null,arguments[0])}else{return a.apply(null,arguments)}}};var g="each
any all".split(/\s/);for(var h=0;h<g.length;h++){b[g[h]]=f(b[g[h]])}})();(function(){var
a=Date,b=a.prototype,c=a.CultureInfo;var d=function(a){var b=[];for(var c=0;c<a.length;c++){if(a[c]instanceof
Array){b=b.concat(d(a[c]))}else{if(a[c]){b.push(a[c])}}
 }return b};a.Grammar={};a.Translator={hour:function(a){return function(){this.hour=Number(a)}},minute:function(a){return
function(){this.minute=Number(a)}},second:function(a){return function(){this.second=Number(a)}},meridian:function(a){return
function(){this.meridian=a.slice(0,1).toLowerCase()}},timezone:function(a){return function(){var
b=a.replace(/[^\d\+\-]/g,"");if(b.length){this.timezoneOffset=Number(b)}else{this.timezone=a.toLowerCase()}}},day:function(a){var
b=a[0];return function(){this.day=Number(b.match(/\d+/)[0])}},month:function(a){return function(){this.month=a.length==3?"jan
feb mar apr may jun jul aug sep oct nov dec".indexOf(a)/4:Number(a)-1}},year:function(a){return
function(){var b=Number(a);this.year=a.length>2?b:b+(b+2e3<c.twoDigitYearMax?2e3:1900)}},rday:function(a){return
function(){switch(a){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(b){b=
 b instanceof Array?b:[b];for(var c=0;c<b.length;c++){if(b[c]){b[c].call(this)}}var d=new
Date;if((this.hour||this.minute)&&!this.month&&!this.year&&!this.day){this.day=d.getDate()}if(!this.year){this.year=d.getFullYear()}if(!this.month&&this.month!==0){this.month=d.getMonth()}if(!this.day){this.day=1}if(!this.hour){this.hour=0}if(!this.minute){this.minute=0}if(!this.second){this.second=0}if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12}else
if(this.meridian=="a"&&this.hour==12){this.hour=0}}if(this.day>a.getDaysInMonth(this.year,this.month)){throw
new RangeError(this.day+" is not a valid value for days.")}var e=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){e.set({timezone:this.timezone})}else
if(this.timezoneOffset){e.set({timezoneOffset:this.timezoneOffset})}return e},finish:function(b){b=b
instanceof Array?d(b):[b];if(b.length===0){return null}for(var c=0;c<b.length;c++){if(typeof
b[c]=="function
 "){b[c].call(this)}}var e=a.today();if(this.now&&!this.unit&&!this.operator){return
new Date}else if(this.now){e=new Date}var f=!!(this.days&&this.days!==null||this.orient||this.operator);var
g,h,i;i=this.orient=="past"||this.operator=="subtract"?-1:1;if(!this.now&&"hour minute
second".indexOf(this.unit)!=-1){e.setTimeToNow()}if(this.month||this.month===0){if("year day
hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;f=true}}if(!f&&this.weekday&&!this.day&&!this.days){var
j=Date[this.weekday]();this.day=j.getDate();if(!this.month){this.month=j.getMonth()}this.year=j.getFullYear()}if(f&&this.weekday&&this.unit!="month"){this.unit="day";g=a.getDayNumberFromName(this.weekday)-e.getDay();h=7;this.days=g?(g+i*h)%h:i*h}if(this.month&&this.unit=="day"&&this.operator){this.value=this.month+1;this.month=null}if(this.value!=null&&this.month!=null&&this.year!=null){this.day=this.value*1}if(this.month&&!this.day&&this.value){e.set({day:this.value*1});if(!f){th
 is.day=this.value*1}}if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;f=true}if(f&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";g=this.month-e.getMonth();h=12;this.months=g?(g+i*h)%h:i*h;this.month=null}if(!this.unit){this.unit="day"}if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+(this.operator=="add"?1:-1)+(this.value||0)*i}else
if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}this[this.unit+"s"]=this.value*i}if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12}else
if(this.meridian=="a"&&this.hour==12){this.hour=0}}if(this.weekday&&!this.day&&!this.days){var
j=Date[this.weekday]();this.day=j.getDate();if(j.getMonth()!==e.getMonth()){this.month=j.getMonth()}}if((this.month||this.month===0)&&!this.day){this.day=1}if(!this.orient&&!this.operator&&this.unit=="week"&&this.v
 alue&&!this.day&&!this.month){return Date.today().setWeek(this.value)}if(f&&this.timezone&&this.day&&this.days){this.day=this.days}return
f?e.add(this):e.set(this)}};var e=a.Parsing.Operators,f=a.Grammar,g=a.Translator,h;f.datePartDelimiter=e.rtoken(/^([\s\-\.\,\/\x27]+)/);f.timePartDelimiter=e.stoken(":");f.whiteSpace=e.rtoken(/^\s*/);f.generalDelimiter=e.rtoken(/^(([\s\,]|at|@|on)+)/);var
i={};f.ctoken=function(a){var b=i[a];if(!b){var d=c.regexPatterns;var f=a.split(/\s+/),g=[];for(var
h=0;h<f.length;h++){g.push(e.replace(e.rtoken(d[f[h]]),f[h]))}b=i[a]=e.any.apply(null,g)}return
b};f.ctoken2=function(a){return e.rtoken(c.regexPatterns[a])};f.h=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),g.hour));f.hh=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2])/),g.hour));f.H=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),g.hour));f.HH=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3])/),g.hour));f.m=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),g.minute));f.mm=e.cache(e.pro
 cess(e.rtoken(/^[0-5][0-9]/),g.minute));f.s=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),g.second));f.ss=e.cache(e.process(e.rtoken(/^[0-5][0-9]/),g.second));f.hms=e.cache(e.sequence([f.H,f.m,f.s],f.timePartDelimiter));f.t=e.cache(e.process(f.ctoken2("shortMeridian"),g.meridian));f.tt=e.cache(e.process(f.ctoken2("longMeridian"),g.meridian));f.z=e.cache(e.process(e.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),g.timezone));f.zz=e.cache(e.process(e.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),g.timezone));f.zzz=e.cache(e.process(f.ctoken2("timezone"),g.timezone));f.timeSuffix=e.each(e.ignore(f.whiteSpace),e.set([f.tt,f.zzz]));f.time=e.each(e.optional(e.ignore(e.stoken("T"))),f.hms,f.timeSuffix);f.d=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1]|\d)/),e.optional(f.ctoken2("ordinalSuffix"))),g.day));f.dd=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1])/),e.optional(f.ctoken2("ordinalSuffix"))),g.day));f.ddd=f.dddd=e.cache(e.process(f.ctoken("sun
mon tue wed 
 thu fri sat"),function(a){return function(){this.weekday=a}}));f.M=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d|\d)/),g.month));f.MM=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d)/),g.month));f.MMM=f.MMMM=e.cache(e.process(f.ctoken("jan
feb mar apr may jun jul aug sep oct nov dec"),g.month));f.y=e.cache(e.process(e.rtoken(/^(\d\d?)/),g.year));f.yy=e.cache(e.process(e.rtoken(/^(\d\d)/),g.year));f.yyy=e.cache(e.process(e.rtoken(/^(\d\d?\d?\d?)/),g.year));f.yyyy=e.cache(e.process(e.rtoken(/^(\d\d\d\d)/),g.year));h=function(){return
e.each(e.any.apply(null,arguments),e.not(f.ctoken2("timeContext")))};f.day=h(f.d,f.dd);f.month=h(f.M,f.MMM);f.year=h(f.yyyy,f.yy);f.orientation=e.process(f.ctoken("past
future"),function(a){return function(){this.orient=a}});f.operator=e.process(f.ctoken("add
subtract"),function(a){return function(){this.operator=a}});f.rday=e.process(f.ctoken("yesterday
tomorrow today now"),g.rday);f.unit=e.process(f.ctoken("second minute hour day week month
year"),function(a){retur
 n function(){this.unit=a}});f.value=e.process(e.rtoken(/^\d\d?(st|nd|rd|th)?/),function(a){return
function(){this.value=a.replace(/\D/g,"")}});f.expression=e.set([f.rday,f.operator,f.value,f.unit,f.orientation,f.ddd,f.MMM]);h=function(){return
e.set(arguments,f.datePartDelimiter)};f.mdy=h(f.ddd,f.month,f.day,f.year);f.ymd=h(f.ddd,f.year,f.month,f.day);f.dmy=h(f.ddd,f.day,f.month,f.year);f.date=function(a){return(f[c.dateElementOrder]||f.mdy).call(this,a)};f.format=e.process(e.many(e.any(e.process(e.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(b){if(f[b]){return
f[b]}else{throw a.Parsing.Exception(b)}}),e.process(e.rtoken(/^[^dMyhHmstz]+/),function(a){return
e.ignore(e.stoken(a))}))),function(a){return e.process(e.each.apply(null,a),g.finishExact)});var
j={};var k=function(a){return j[a]=j[a]||f.format(a)[0]};f.formats=function(a){if(a instanceof
Array){var b=[];for(var c=0;c<a.length;c++){b.push(k(a[c]))}return e.any.apply(null,b)}else{return
k(a)}};f._for
 mats=f.formats(['"yyyy-MM-ddTHH:mm:ssZ"',"yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd,
MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);f._start=e.process(e.set([f.date,f.time,f.expression],f.generalDelimiter,f.whiteSpace),g.finish);f.start=function(a){try{var
b=f._formats.call({},a);if(b[1].length===0){return b}}catch(c){}return f._start.call({},a)};a._parse=a.parse;a.parse=function(b){var
c=null;if(!b){return null}if(b instanceof Date){return b}try{c=a.Grammar.start.call({},b.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"))}catch(d){return
null}return c[1].length===0?c[0]:null};a.getParseFunction=function(b){var c=a.Grammar.formats(b);return
function(a){var b=null;try{b=c.call({},a)}catch(d){return null}return b[1].length===0?b[0]:null}};a.parseExact=function(b,c){return
a.getParseFunction(c)(b)}})()
+


Mime
View raw message