3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
15 <div id="cls-Ext.calendar.DayBodyTemplate"></div>/**
16 * @class Ext.calendar.DayBodyTemplate
17 * @extends Ext.XTemplate
18 * <p>This is the template used to render the scrolling body container used in {@link Ext.calendar.DayView DayView} and
19 * {@link Ext.calendar.WeekView WeekView}. This template is automatically bound to the underlying event store by the
20 * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
21 * <p>Note that this template would not normally be used directly. Instead you would use the {@link Ext.calendar.DayViewTemplate}
22 * that internally creates an instance of this template along with a {@link Ext.calendar.DayHeaderTemplate}.</p>
24 * @param {Object} config The config object
26 Ext.calendar.DayBodyTemplate = function(config){
28 Ext.apply(this, config);
30 Ext.calendar.DayBodyTemplate.superclass.constructor.call(this,
31 '<table class="ext-cal-bg-tbl" cellspacing="0" cellpadding="0">',
34 '<td class="ext-cal-gutter"></td>',
35 '<td colspan="{dayCount}">',
36 '<div class="ext-cal-bg-rows">',
37 '<div class="ext-cal-bg-rows-inner">',
39 '<div class="ext-cal-bg-row">',
40 '<div class="ext-cal-bg-row-div ext-row-{[xindex]}"></div>',
48 '<td class="ext-cal-day-times">',
50 '<div class="ext-cal-bg-row">',
51 '<div class="ext-cal-day-time-inner">{.}</div>',
56 '<td class="ext-cal-day-col">',
57 '<div class="ext-cal-day-col-inner">',
58 '<div id="{[this.id]}-day-col-{.:date("Ymd")}" class="ext-cal-day-col-gutter"></div>',
68 Ext.extend(Ext.calendar.DayBodyTemplate, Ext.XTemplate, {
70 applyTemplate : function(o){
71 this.today = new Date().clearTime();
72 this.dayCount = this.dayCount || 1;
75 dt = o.viewStart.clone(),
78 for(; i<this.dayCount; i++){
79 days[i] = dt.add(Date.DAY, i);
83 dt = new Date().clearTime();
85 times.push(dt.format('ga'));
86 dt = dt.add(Date.HOUR, 1);
89 return Ext.calendar.DayBodyTemplate.superclass.applyTemplate.call(this, {
91 dayCount: days.length,
97 Ext.calendar.DayBodyTemplate.prototype.apply = Ext.calendar.DayBodyTemplate.prototype.applyTemplate;