PDA

View Full Version : Date custom Renderer problem



Nagadev
21 Aug 2009, 4:55 AM
Hi

I tried with following custom renderer for date column in a grid.

column:

{name: 'createdDate', mapping:'createdDate',type: 'date', dateFormat: 'Y-m-d H:i:s:u'},

renderer:


renderer:function(val){

if(!(val instanceof Date)){
val = Date.parseDate(val,'Y-m-d'); // val is becoming undefined here.
}
return val.dateFormat('Y-m-d');////here I am getting val undefined error
}



is anything wrong in the code ?

Here is the data : "2009-08-15 00:00:00.0"

Nagadev
21 Aug 2009, 6:23 AM
I got the problem .. I shouldnot have : after s , it should be s.u

column:


{name: 'createdDate', mapping:'createdDate',type: 'date', dateFormat: 'Y-m-d H:i:s.u'},