PDA

View Full Version : [CLOSED] How to format date yyyy/MM/dd using renderer.fn



mis@adphk.com
Mar 14, 2013, 9:20 AM
I am using renderer.fn and would like to change the cell backgroud color and display date format in yyyy/MM/dd.




function (value, metadata)
{
metadata.style="background-color:#FF00FF";
return Ext.Util.Format.Date(value);
}

Daniil
Mar 14, 2013, 9:58 AM
Hi,

The "Util" and "Date" must be lowercase "util" and "date".

Also you have to pass a format as the second parameter.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext.util.Format-method-date

Here is the specification of formats.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext.Date

mis@adphk.com
Mar 14, 2013, 10:20 AM
Hi,

The "Util" and "Date" must be lowercase "util" and "date".

Also you have to pass a format as the second parameter.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext.util.Format-method-date

Here is the specification of formats.
http://docs.sencha.com/ext-js/4-2/#!/api/Ext.Date

it works, Ext.util.Format.date(value, 'Y/m/d') thanks