text: var DateFormat={};(function(e){var a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n=["January","February","March","April","May","June","July","August","September","October","November","December"],s={Jan:"01",Feb:"02",Mar:"03",Apr:"04",May:"05",Jun:"06",Jul:"07",Aug:"08",Sep:"09",Oct:"10",Nov:"11",Dec:"12"},o=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.?\d{0,3}[Z\-+]?(\d{2}:?\d{2})?/;e.format=function(){function e(e){return a[parseInt(e,10)]||e}function i(e){return r[parseInt(e,10)]||e}function u(e){var a=parseInt(e,10)-1;return t[a]||e}function c(e){var a=parseInt(e,10)-1;return n[a]||e}function h(e){return s[e]||e}function l(e){var a,r,t,n,s,o=e,i="";return-1!==o.indexOf(".")&&(n=o.split("."),o=n[0],i=n[n.length-1]),s=o.split(":"),s.length>=3?(a=s[0],r=s[1],t=s[2].replace(/\s.+/,"").replace(/[a-z]/gi,""),o=o.replace(/\s.+/,"").replace(/[a-z]/gi,""),{time:o,hour:a,minute:r,second:t,millis:i}):{time:"",hour:"",minute:"",second:"",millis:""}}function m(e,a){for(var r=a-String(e).length,t=0;t<r;t++)e="0"+e;return e}return{parseDate:function(e){var a,r,t={date:null,year:null,month:null,dayOfMonth:null,dayOfWeek:null,time:null};if("number"==typeof e)return this.parseDate(new Date(e));if("function"==typeof e.getFullYear)t.year=String(e.getFullYear()),t.month=String(e.getMonth()+1),t.dayOfMonth=String(e.getDate()),t.time=l(e.toTimeString()+"."+e.getMilliseconds());else if(-1!=e.search(o))a=e.split(/[T\+-]/),t.year=a[0],t.month=a[1],t.dayOfMonth=a[2],t.time=l(a[3].split(".")[0]);else switch(a=e.split(" "),6===a.length&&isNaN(a[5])&&(a[a.length]="()"),a.length){case 6:t.year=a[5],t.month=h(a[1]),t.dayOfMonth=a[2],t.time=l(a[3]);break;case 2:r=a[0].split("-"),t.year=r[0],t.month=r[1],t.dayOfMonth=r[2],t.time=l(a[1]);break;case 7:case 9:case 10:t.year=a[3];var n=parseInt(a[1]),s=parseInt(a[2]);n&&!s?(t.month=h(a[2]),t.dayOfMonth=a[1]):(t.month=h(a[1]),t.dayOfMonth=a[2]),t.time=l(a[4]);break;case 1:r=a[0].split(""),t.year=r[0]+r[1]+r[2]+r[3],t.month=r[5]+r[6],t.dayOfMonth=r[8]+r[9],t.time=l(r[13]+r[14]+r[15]+r[16]+r[17]+r[18]+r[19]+r[20]);break;default:return null}return t.time?t.date=new Date(t.year,t.month-1,t.dayOfMonth,t.time.hour,t.time.minute,t.time.second,t.time.millis):t.date=new Date(t.year,t.month-1,t.dayOfMonth),t.dayOfWeek=String(t.date.getDay()),t},date:function(a,r){try{var t=this.parseDate(a);if(null===t)return a;for(var n,s=t.year,o=t.month,h=t.dayOfMonth,l=t.dayOfWeek,f=t.time,y="",d="",b="",k=!1,p=0;p<r.length;p++){var M=r.charAt(p),g=r.charAt(p+1);if(k)"'"==M?(d+=""===y?"'":y,y="",k=!1):y+=M;else switch(y+=M,b="",y){case"ddd":d+=e(l),y="";break;case"dd":if("d"===g)break;d+=m(h,2),y="";break;case"d":if("d"===g)break;d+=parseInt(h,10),y="";break;case"D":h=1==h||21==h||31==h?parseInt(h,10)+"st":2==h||22==h?parseInt(h,10)+"nd":3==h||23==h?parseInt(h,10)+"rd":parseInt(h,10)+"th",d+=h,y="";break;case"MMMM":d+=c(o),y="";break;case"MMM":if("M"===g)break;d+=u(o),y="";break;case"MM":if("M"===g)break;d+=m(o,2),y="";break;case"M":if("M"===g)break;d+=parseInt(o,10),y="";break;case"y":case"yyy":if("y"===g)break;d+=y,y="";break;case"yy":if("y"===g)break;d+=String(s).slice(-2),y="";break;case"yyyy":d+=s,y="";break;case"HH":d+=m(f.hour,2),y="";break;case"H":if("H"===g)break;d+=parseInt(f.hour,10),y="";break;case"hh":n=0===parseInt(f.hour,10)?12:f.hour<13?f.hour:f.hour-12,d+=m(n,2),y="";break;case"h":if("h"===g)break;n=0===parseInt(f.hour,10)?12:f.hour<13?f.hour:f.hour-12,d+=parseInt(n,10),y="";break;case"mm":d+=m(f.minute,2),y="";break;case"m":if("m"===g)break;d+=parseInt(f.minute,10),y="";break;case"ss":d+=m(f.second.substring(0,2),2),y="";break;case"s":if("s"===g)break;d+=parseInt(f.second,10),y="";break;case"S":case"SS":if("S"===g)break;d+=y,y="";break;case"SSS":d+=m(f.millis.substring(0,3),3),y="";break;case"a":d+=f.hour>=12?"PM":"AM",y="";break;case"p":d+=f.hour>=12?"p.m.":"a.m.",y="";break;case"E":d+=i(l),y="";break;case"'":y="",k=!0;break;default:d+=M,y=""}}return d+=b,d}catch(e){return console&&console.log&&console.log(e),a}},prettyDate:function(e){var a,r,t,n,s;if("string"!=typeof e&&"number"!=typeof e||(a=new Date(e)),"object"==typeof e&&(a=new Date(e.toString())),r=((new Date).getTime()-a.getTime())/1e3,t=Math.abs(r),n=Math.floor(t/86400),!isNaN(n))return s=r<0?"from now":"ago",t<60?r>=0?"just now":"in a moment":t<120?"1 minute "+s:t<3600?Math.floor(t/60)+" minutes "+s:t<7200?"1 hour "+s:t<86400?Math.floor(t/3600)+" hours "+s:1===n?r>=0?"Yesterday":"Tomorrow":n<7?n+" days "+s:7===n?"1 week "+s:n<31?Math.ceil(n/7)+" weeks "+s:"more than 5 weeks "+s},toBrowserTimeZone:function(e,a){return this.date(new Date(e),a||"MM/dd/yyyy HH:mm:ss")}}}()})(DateFormat),function(e){e.format=DateFormat.format}(jQuery);