/** * @version: 1.0 Alpha-1 * @author: Coolite Inc. http://www.coolite.com/ * @date: 2008-05-13 * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved. * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. * @website: http://www.datejs.com/ */ (function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$f=[],p=function(s,l){if(!l){l=2;} return("000"+s).slice(l*-1);};$D.normalizeFormat=function(format){$f=[];var t=new Date().$format(format);return $f.join("");};$D.strftime=function(format,time){return new Date(time*1000).$format(format);};$D.strtotime=function(time){var d=$D.parse(time);d.addMinutes(d.getTimezoneOffset()*-1);return Math.round($D.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds())/1000);};$P.$format=function(format){var x=this,y,t=function(v){$f.push(v);return x.toString(v);};return format?format.replace(/(%|\\)?.|%%/g,function(m){if(m.charAt(0)==="\\"||m.substring(0,2)==="%%"){return m.replace("\\","").replace("%%","%");} switch(m){case"d":case"%d":return t("dd");case"D":case"%a":return t("ddd");case"j":case"%e":return t("d");case"l":case"%A":return t("dddd");case"N":case"%u":return x.getDay()+1;case"S":return t("S");case"w":case"%w":return x.getDay();case"z":return x.getOrdinalNumber();case"%j":return p(x.getOrdinalNumber(),3);case"%U":var d1=x.clone().set({month:0,day:1}).addDays(-1).moveToDayOfWeek(0),d2=x.clone().addDays(1).moveToDayOfWeek(0,-1);return(d2