PDA

View Full Version : Date objects not displaying on Android



rstuart
21 Jan 2011, 5:25 AM
I have the following simple class based on a List:


Ext.regModel('Event', {
'fields': [
{name: 'title', type: 'string'},
{name: 'start', type: 'date'},
{name: 'end', type: 'date'}
]
})

Lca2011.ui.EventList = Ext.extend(Ext.List, {
initComponent: function() {
Ext.apply(this, {
store: new Ext.data.Store({
model: 'Event',
proxy: {
type: 'ajax',
url : this.url,
reader: {
type: 'json',
root: 'events'
}
},
autoLoad: true
}),
fullscreen: true,
itemTpl : new Ext.XTemplate('<p class="event">{start} - {end} {title}</p>')
});
Lca2011.ui.EventList.superclass.initComponent.apply(this, arguments);
}
});

Whenever I display an instance of that class in Chrome, it works fine. On my Nexus One however, that date ojects just don't render at all. All you see for the row is " - Event X". I have tried using the date format function but there seems to be a problem with date objects and Android.

Has anyone seen this before?

evant
22 Jan 2011, 10:32 PM
You have type: 'date', but what format is returned by your server? I seem to recall a difference with the way Safari parses datres being more restrictive, so you should specify the dateFormat and have Touch parse it as a date.