-
4 Jun 2007 1:54 AM #1
Render a Date field
Render a Date field
Hi all,
I have an xml which returns a date in format 2007-06-04 14:47:00.0 and I tried using:
but the grid shows NaN. I hope somebody can help me.Code:renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
Thanks,
Marc
-
18 Jun 2007 2:15 AM #2
Here is a possible solution
Here is a possible solution
I had the same going on with Json Data and I came up with that little gizmo:
... or the short form:PHP Code:function renderDate(value){
var dt = new Date();
dt = Date.parseDate(value, "Y-m-d h:i:s");
return dt.format('d.m.Y H:i:s');
}
var cm = new Ext.grid.ColumnModel(
[
{header: 'Date', sortable: true, dataIndex: 'somedate', renderer: renderDate},
.....
]
);
cheersPHP Code:function renderDate(value){
return Date.parseDate(value,"Y-m-d h:i:s").format('d.m.Y H:i:s');
}

-
27 Sep 2011 11:11 PM #3
thanks
thanks
excelent simonspitz, that's what i looking for all night...
at last i found it.....
mmmhh... wonder what could i give to you to bring back the favor
but any way thanks mate..


Reply With Quote