PDA

View Full Version : Problem with the date format in Grid



suryanarendra
7 May 2012, 4:56 PM
Hi,

I am trying to display row cretedOn and lastModifiedOn fields on grid.

Code:
{
header:"Created On",
dataIndex:'createdOn',
xtype:'datecolumn',
format:'Y-m-d H:i:s',
},
{
header:"Last Updated On",
dataIndex:'lastUpdatedOn',
xtype:'datecolumn',
format:'Y-m-d H:i:s',
}


JSON response coming as "createdOn": 1335386672000" ,"lastUpdatedOn": 1335386672000" but on UI those fields are coming as "0NaN-NaN-NaN Nan:NaN:NaN".

I am using java.util.Date on back-end.

Can somebody help to understand what is the problem

vietits
7 May 2012, 5:45 PM
How do you define 'lastUpdatedOn' and 'createdOn' fields in your model? Try to define them by setting dateFormat set to 'time'.


...
name: 'lastUpdatedOn', type: 'date', dateFormat: 'time'
...

suryanarendra
7 May 2012, 7:36 PM
Hi,

Thank you. It worked and it solved other problem with Safari browser also.