]> git.proxmox.com Git - sencha-touch.git/blob - src/examples/kiva/app/view/detail/Schedule.js
import Sencha Touch 2.4.2 source
[sencha-touch.git] / src / examples / kiva / app / view / detail / Schedule.js
1 Ext.define('Kiva.view.detail.Schedule', {
2 extend: 'Ext.Container',
3 xtype: 'detailSchedule',
4 requires: ['Ext.DateExtras'],
5
6 config: {
7 cls: 'detail-card',
8 styleHtmlContent: true,
9 scrollable: {
10 direction: 'vertical',
11 directionLock: true
12 },
13
14 tpl: Ext.create('Ext.XTemplate',
15 '<h1>Repayment Schedule</h1>',
16 '<tpl for=".">',
17 '<div class="payment">',
18 '<div>{[this.formatDueDate(values.due_date)]} <span>${amount}</span></div>',
19 '</div>',
20 '</tpl>',
21 {
22 formatDueDate: function(date) {
23 date = date.split('T')[0];
24
25 var format = "j M Y";
26 parsed = new Date(Ext.Date.parse(date, "Y-m-d"));
27
28 return Ext.Date.format(parsed, format);
29 }
30 }
31 )
32 }
33 });