]>
git.proxmox.com Git - extjs.git/blob - extjs/examples/classic/calendar/src/template/DayBody.js
2 * @class Ext.calendar.template.DayBody
3 * @extends Ext.XTemplate
4 * <p>This is the template used to render the scrolling body container used in {@link Ext.calendar.DayView DayView} and
5 * {@link Ext.calendar.WeekView WeekView}. This template is automatically bound to the underlying event store by the
6 * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
7 * <p>Note that this template would not normally be used directly. Instead you would use the {@link Ext.calendar.DayViewTemplate}
8 * that internally creates an instance of this template along with a {@link Ext.calendar.DayHeaderTemplate}.</p>
10 * @param {Object} config The config object
12 Ext
.define('Ext.calendar.template.DayBody', {
13 extend
: 'Ext.XTemplate',
15 'Ext.calendar.util.Date'
18 constructor: function(config
){
20 Ext
.apply(this, config
);
23 '<table class="ext-cal-bg-tbl" cellspacing="0" cellpadding="0">',
26 '<td class="ext-cal-gutter"></td>',
27 '<td colspan="{dayCount}">',
28 '<div class="ext-cal-bg-rows">',
29 '<div class="ext-cal-bg-rows-inner">',
31 '<div class="ext-cal-bg-row">',
32 '<div class="ext-cal-bg-row-div ext-row-{[xindex]}"></div>',
40 '<td class="ext-cal-day-times">',
42 '<div class="ext-cal-bg-row">',
43 '<div class="ext-cal-day-time-inner">{.}</div>',
48 '<td class="ext-cal-day-col">',
49 '<div class="ext-cal-day-col-inner">',
50 '<div id="{[this.id]}-day-col-{.:date("Ymd")}" class="ext-cal-day-col-gutter"></div>',
61 applyTemplate : function(o
){
62 this.today
= Ext
.calendar
.util
.Date
.today();
63 this.dayCount
= this.dayCount
|| 1;
67 dt
= Ext
.Date
.clone(o
.viewStart
),
70 for(; i
<this.dayCount
; i
++){
71 days
[i
] = Ext
.calendar
.util
.Date
.add(dt
, {days
: i
});
74 // use a fixed DST-safe date so times don't get skipped on DST boundaries
75 dt
= Ext
.Date
.clearTime(new Date('5/26/1972'));
78 times
.push(Ext
.Date
.format(dt
, 'ga'));
79 dt
= Ext
.calendar
.util
.Date
.add(dt
, {hours
: 1});
82 return this.applyOut({
84 dayCount
: days
.length
,
89 apply: function(values
) {
90 return this.applyTemplate
.apply(this, arguments
);