Date.dayInitials=["S","M","T","W","T","F","S"];Date.monthShortNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.monthFullNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.fromISODate=function(b){if(b){var a=b.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})([ T]([0-9]{2}):([0-9]{2}):([0-9]{2}))?/);if(a&&a[4]){return new Date(a[1],a[2]-1,a[3],a[5],a[6],a[7])}else{if(a){return new Date(a[1],a[2]-1,a[3])}}}return null};Date.prototype.toISODate=function(f){var e=this.getFullYear();var a=this.getMonth()+1;var c=this.getDate();var b=e+"-"+(a<10?"0"+a:a)+"-"+(c<10?"0"+c:c);if(f){return b+" "+this.toISOTime()}return b};Date.prototype.toISOTime=function(){var c=this.getHours();var a=this.getMinutes();var b=this.getSeconds();return(c<10?"0"+c:c)+":"+(a<10?"0"+a:a)+":"+(b<10?"0"+b:b)};Date.prototype.toMyFullDate=function(){return Date.monthFullNames[this.getMonth()]+" "+this.getDate()+", "+this.getFullYear()};Date.prototype.toMyDate=function(b){var a=this.getDate()+" "+Date.monthFullNames[this.getMonth()]+", "+this.getFullYear();if(b){return a+" "+this.toMyTime()}return a};Date.prototype.toMyTime=function(){var b=this.getHours();var a=this.getMinutes();return(b<13?(b==0?"12":b):b-12)+":"+(a<10?"0"+a:a)+(b<12?"am":"pm")};Date.prototype.isMidnight=function(){return this.getHours()==0&&this.getMinutes()==0&&this.getSeconds()==0};Date.prototype.isSameDate=function(a){return a&&this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()};Date.prototype.isSameMonth=function(a){return a&&this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()};Date.prototype.isToday=function(){return this.isSameDate(new Date())};Date.fromHumanDate=function(d){var b=new Date();if(d=="yesterday"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()-1).valueOf()}else{if(d=="today"||d=="now"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()).valueOf()}else{if(d=="tomorrow"){return new Date(b.getFullYear(),b.getMonth(),b.getDate()+1).valueOf()}}}var c=new Date(Date.parse(d));var a=d.match(new RegExp("^([0-9]{1,2})[ -/]([0-9]{1,2})[ -/]((19|20)?[0-9]{2})"));if(a){if(a[3]<70){a[3]="20"+a[3]}else{if(a[3]<100){a[3]="19"+a[3]}}c.setFullYear(a[3]);c.setMonth(a[2]-1);c.setDate(a[1])}return c.valueOf()};function formatDate(a){if(a.isMidnight()){return a.getDate()+" "+Date.monthFullNames[a.getMonth()]}else{return a.getDate()+" "+Date.monthFullNames[a.getMonth()]+", "+a.toMyTime()}}function formatDateRange(b,a){if(b>=a){return formatDate(b)}else{if(b.isSameDate(a)){return b.getDate()+" "+Date.monthFullNames[b.getMonth()]+", "+b.toMyTime()+" - "+a.toMyTime()}else{if(b.isSameMonth(a)&&b.isMidnight()&&a.isMidnight()){return b.getDate()+" - "+formatDate(a)}else{return formatDate(b)+" - "+formatDate(a)}}}};
