PDA

View Full Version : date format in IE - shows blank!!



baven
1 Jul 2010, 10:24 AM
Hi,
I am getting a date value as 2010-06-04T09:32:16
and it is displaying as 06/04/2010 09:16:32 AM in Firefox, but in IE it is getting displayed as
blank value!

My JsonReader has :
{name: 'receivedDate', type:'date'}

and my column-model is :

{
header: "Date",
width: 40,
sortable: false,
resizable:false,
locked: true,
dataIndex: 'receivedDate',
renderer:Ext.util.Format.dateRenderer('m/d/Y h:i:s A')
}


Can u please tell me why it is not getting displayed in IE? I am using ExtJs 3.2.1

mankz
1 Jul 2010, 10:39 AM
You have to tell Ext JS how to parse your date, FF works since you can do new Date("2010-06-04T09:32:16"). In IE I guess not so much.

add dateFormat to your date field definition


{name: 'receivedDate', type:'date', dateFormat:'c'}

baven
1 Jul 2010, 10:47 AM
-

mysticav
14 Jan 2012, 10:49 PM
Exactly the same situation but not working in IE 8.

Getting the value from PHP, using ISO 8601. I get this: "2012-01-04T22:36:30-08:00"

In Ext ver. 4.1 I'm defining the column as:
{name: 'created', type: 'date', dateFormat:'c'},

It works perfectly on every browser, except IE8.

Any idea ?

chethanr_18
7 Jun 2016, 11:21 PM
You have to tell Ext JS how to parse your date, FF works since you can do new Date("2010-06-04T09:32:16"). In IE I guess not so much.

add dateFormat to your date field definition


{name: 'receivedDate', type:'date', dateFormat:'c'}

Thanks a lot, this worked so well for me. The date wasn't displaying in IE 11. However, curious to know the other formats that can be used instead of "c".
I tried many of the formats specified in https://docs.sencha.com/extjs/6.0/6.0.1-classic/#!/api/Ext.Date none of them worked except "c"
Also how does the dateReadFormat and dateWriteFormat work.

Please let me know.

Thanks,
Chethan