Date.padded2=function(A){padded2=A.toString();if((parseInt(A)<10)||(parseInt(A)==null)){padded2="0"+padded2}return padded2};Date.prototype.getAMPMHour=function(){hour=Date.padded2(this.getHours());return(hour==null)?0:(hour>24?hour-24:hour)};Date.prototype.getAMPM=function(){return(this.getHours()<12)?"":""};Date.prototype.toFormattedString=function(A){str=this.getFullYear()+"-"+(this.getMonth()+1)+"-"+Date.padded2(this.getDate());if(A){hour=this.getHours();str+=" "+this.getAMPMHour()+":"+this.getPaddedMinutes()}return str};Date.parseFormattedString=function(B){var C="([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?";var E=B.match(new RegExp(C,"i"));if(E==null){return Date.parse(B)}var D=0;var A=new Date(E[1],0,1);if(E[3]){A.setMonth(E[3]-1)}if(E[5]){A.setDate(E[5])}if(E[7]){A.setHours(parseInt(E[7],10))}if(E[8]){A.setMinutes(E[8])}if(E[10]){A.setSeconds(E[10])}return A};