|
|
/*This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License UsageThis file may be used under the terms of the GNU General Public License version 3.0 aspublished by the Free Software Foundation and appearing in the file LICENSE included in thepackaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales departmentat http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25*/Ext.ns("Ext.calendar");(function(){Ext.apply(Ext.calendar,{Date:{diffDays:function(b,a){day=1000*60*60*24;diff=a.clearTime(true).getTime()-b.clearTime(true).getTime();return Math.ceil(diff/day)},copyTime:function(c,b){var a=b.clone();a.setHours(c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds());return a},compare:function(c,b,a){if(a!==true){c=c.clone();c.setMilliseconds(0);b=b.clone();b.setMilliseconds(0)}return b.getTime()-c.getTime()},maxOrMin:function(a){var f=(a?0:Number.MAX_VALUE),c=0,b=arguments[1],e=b.length;for(;c<e;c++){f=Math[a?"max":"min"](f,b[c].getTime())}return new Date(f)},max:function(){return this.maxOrMin.apply(this,[true,arguments])},min:function(){return this.maxOrMin.apply(this,[false,arguments])}}})})();Ext.calendar.DayHeaderTemplate=function(a){Ext.apply(this,a);this.allDayTpl=new Ext.calendar.BoxLayoutTemplate(a);this.allDayTpl.compile();Ext.calendar.DayHeaderTemplate.superclass.constructor.call(this,'<div class="ext-cal-hd-ct">','<table class="ext-cal-hd-days-tbl" cellspacing="0" cellpadding="0">',"<tbody>","<tr>",'<td class="ext-cal-gutter"></td>','<td class="ext-cal-hd-days-td"><div class="ext-cal-hd-ad-inner">{allDayTpl}</div></td>','<td class="ext-cal-gutter-rt"></td>',"</tr>","</tobdy>","</table>","</div>")};Ext.extend(Ext.calendar.DayHeaderTemplate,Ext.XTemplate,{applyTemplate:function(a){return Ext.calendar.DayHeaderTemplate.superclass.applyTemplate.call(this,{allDayTpl:this.allDayTpl.apply(a)})}});Ext.calendar.DayHeaderTemplate.prototype.apply=Ext.calendar.DayHeaderTemplate.prototype.applyTemplate;Ext.calendar.DayBodyTemplate=function(a){Ext.apply(this,a);Ext.calendar.DayBodyTemplate.superclass.constructor.call(this,'<table class="ext-cal-bg-tbl" cellspacing="0" cellpadding="0">',"<tbody>",'<tr height="1">','<td class="ext-cal-gutter"></td>','<td colspan="{dayCount}">','<div class="ext-cal-bg-rows">','<div class="ext-cal-bg-rows-inner">','<tpl for="times">','<div class="ext-cal-bg-row">','<div class="ext-cal-bg-row-div ext-row-{[xindex]}"></div>',"</div>","</tpl>","</div>","</div>","</td>","</tr>","<tr>",'<td class="ext-cal-day-times">','<tpl for="times">','<div class="ext-cal-bg-row">','<div class="ext-cal-day-time-inner">{.}</div>',"</div>","</tpl>","</td>",'<tpl for="days">','<td class="ext-cal-day-col">','<div class="ext-cal-day-col-inner">','<div id="{[this.id]}-day-col-{.:date("Ymd")}" class="ext-cal-day-col-gutter"></div>',"</div>","</td>","</tpl>","</tr>","</tbody>","</table>")};Ext.extend(Ext.calendar.DayBodyTemplate,Ext.XTemplate,{applyTemplate:function(e){this.today=new Date().clearTime();this.dayCount=this.dayCount||1;var a=0,f=[],b=e.viewStart.clone(),c;for(;a<this.dayCount;a++){f[a]=b.add(Date.DAY,a)}c=[];b=new Date().clearTime();for(a=0;a<24;a++){c.push(b.format("ga"));b=b.add(Date.HOUR,1)}return Ext.calendar.DayBodyTemplate.superclass.applyTemplate.call(this,{days:f,dayCount:f.length,times:c})}});Ext.calendar.DayBodyTemplate.prototype.apply=Ext.calendar.DayBodyTemplate.prototype.applyTemplate;Ext.calendar.DayViewTemplate=function(a){Ext.apply(this,a);this.headerTpl=new Ext.calendar.DayHeaderTemplate(a);this.headerTpl.compile();this.bodyTpl=new Ext.calendar.DayBodyTemplate(a);this.bodyTpl.compile();Ext.calendar.DayViewTemplate.superclass.constructor.call(this,'<div class="ext-cal-inner-ct">',"{headerTpl}","{bodyTpl}","</div>")};Ext.extend(Ext.calendar.DayViewTemplate,Ext.XTemplate,{applyTemplate:function(a){return Ext.calendar.DayViewTemplate.superclass.applyTemplate.call(this,{headerTpl:this.headerTpl.apply(a),bodyTpl:this.bodyTpl.apply(a)})}});Ext.calendar.DayViewTemplate.prototype.apply=Ext.calendar.DayViewTemplate.prototype.applyTemplate;Ext.calendar.BoxLayoutTemplate=function(a){Ext.apply(this,a);var b=this.showWeekLinks?'<div id="{weekLinkId}" class="ext-cal-week-link">{weekNum}</div>':"";Ext.calendar.BoxLayoutTemplate.superclass.constructor.call(this,'<tpl for="weeks">','<div id="{[this.id]}-wk-{[xindex-1]}" class="ext-cal-wk-ct" style="top:{[this.getRowTop(xindex, xcount)]}%; height:{[this.getRowHeight(xcount)]}%;">',b,'<table class="ext-cal-bg-tbl" ce
|