;Date.dayNames="Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(",");Date.abbrDayNames="Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",");Date.monthNames="January,February,March,April,May,June,July,August,September,October,November,December".split(",");Date.abbrMonthNames="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(",");Date.firstDayOfWeek=1;Date.format="dd/mm/yyyy";Date.fullYearStart="20";
(function(){function b(a,b){Date.prototype[a]||(Date.prototype[a]=b)}b("isLeapYear",function(){var a=this.getFullYear();return 0==a%4&&0!=a%100||0==a%400});b("isWeekend",function(){return 0==this.getDay()||6==this.getDay()});b("isWeekDay",function(){return!this.isWeekend()});b("getDaysInMonth",function(){return[31,this.isLeapYear()?29:28,31,30,31,30,31,31,30,31,30,31][this.getMonth()]});b("getDayName",function(a){return a?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});b("getMonthName",
function(a){return a?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]});b("getDayOfYear",function(){var a=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-a.getTime())/864E5)});b("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});b("setDayOfYear",function(a){this.setMonth(0);this.setDate(a);return this});b("addYears",function(a){this.setFullYear(this.getFullYear()+a);return this});b("addMonths",function(a){var b=this.getDate();this.setMonth(this.getMonth()+
a);b>this.getDate()&&this.addDays(-this.getDate());return this});b("addDays",function(a){this.setDate(this.getDate()+a);return this});b("addHours",function(a){this.setHours(this.getHours()+a);return this});b("addMinutes",function(a){this.setMinutes(this.getMinutes()+a);return this});b("addSeconds",function(a){this.setSeconds(this.getSeconds()+a);return this});b("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});b("getOrdinal",function(){return 1==
this.getDate()||21==this.getDate()||31==this.getDate()?"st":2==this.getDate()||22==this.getDate()?"nd":3==this.getDate()||23==this.getDate()?"rd":"th"});b("asString",function(){return Date.format.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear()+"").substring(2)).split("mmm").join(this.getMonthName(!0)).split("mm").join(f(this.getMonth()+1)).split("dd").join(f(this.getDate()))});Date.fromString=function(a){var b=Date.format,c=new Date("01/01/1977"),d=b.indexOf("yyyy");-1<
d?c.setFullYear(Number(a.substr(d,4))):c.setFullYear(Number(Date.fullYearStart+a.substr(b.indexOf("yy"),2)));d=b.indexOf("mmm");if(-1<d){for(var d=a.substr(d,3),e=0;e<Date.abbrMonthNames.length&&!(Date.abbrMonthNames[e]==d);e++);c.setMonth(e)}else c.setMonth(Number(a.substr(b.indexOf("mm"),2))-1);c.setDate(Number(a.substr(b.indexOf("dd"),2)));return isNaN(c.getTime())?!1:c};var f=function(a){a="0"+a;return a.substring(a.length-2)}})();
