tags:

views:

28

answers:

3

I am using Grails with extJS in my project. I have a date column in my display page. It gets displayed as 2010-09-29T04:00:00Z.

After i used the below to render the date, I got the date displayed as NaN/NaN/NaN

{header: "Date", width: 90, renderer : ('m/d/Y'), sortable:true, dataIndex: 'date'}

Am I missing something here?

Thanks!

A: 

Try adding the following function to your code:

function RENDER_date(value){return value ? value.dateFormat('m/d/Y') : '';}

Then set the renderer property:

renderer: RENDER_date
Ergo Summary
Thanks Ergo/Chau.It seems that some work only for Firefox and not for IE7. The code mentioend in my query works with Firefox and I get a right output. However, with IE7 it doesnt.Had to make the below chnage for it to work in IE7.
Alex
A: 

Thanks Ergo/Chau.It seems that some work only for Firefox and not for IE7. The code mentioned in my query works with Firefox and I get the right output. However, with IE7 it doesnt. Had to make the below chnage for it to work in IE7.

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

and in ColumnModel:

{header: "Date", width: 90, dataIndex: 'dte', renderer : Ext.util.Format.dateRenderer('m-d-Y') },

Alex
Thanks for adding in your solution, always good to know- and glad it works!
Ergo Summary
A: 

Add to format: 'm/d/Y' to your grid and store config.

turbod