Reputation: 1387
I'm trying to display a date column in a grid using ExtJs 4.1.
My model is
fields: [
{name: 'MYDATE', type: 'date'}
]
and the response I get from the server is
{
"success": true,
"totalRows": "1",
"data": [
{
"MYDATE": "2015-01-22 09:47:43"
}
]
}
In chrome it works
but in IE10 and Mozilla it does not.
Just to mention that this problem comes before applying renderers
I have also tried to add format in the model
fields: [
{name: 'MYDATE', type: 'date', format : 'c'}
]
The database MSSQL has the value
2015-01-22 09:47:43.590
What am I doing wrong?
Upvotes: 2
Views: 1480
Reputation: 3153
To specify a Date format in a model, you must use the dateFormat
property, not format
: http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.data.Field-cfg-dateFormat
Your error is caused by your server returning a date in the Y-m-d H:i:s
format instead of the standard UTC format. Chrome and Safari will interpret this, but Firefox and IE will not.
Upvotes: 2
Reputation: 755
Have you tried:
format: 'Y-m-d H:i:s'
More information on formats here
Upvotes: 0