我在extjs 3.4中使用了网格,并且网格中有一个包含日期的列。 现在我想在网格中显示它之前更改日期格式。 对于此,我使用以下的代码两种方式日期渲染器给出与输入日期不同的日期
asm_profile_date_format = '缩略词,Y'
column = new Ext.grid.Column({
header : map['label'],
sortable : true,
dataIndex : map['name'],
renderer :Ext.util.Format.dateRenderer(asm_profile_date_format)
});
和
renderer : function(value)
{
if(value == null)
return ' '
else
{
return value.format(asm_profile_date_format);;
}
}
在这里,我得到值/输入日期是19/6/2013,但我得到的渲染器的日期是Jul 6,2014。
你在找什么格式? – Hariharan
@Hariharan格式“2014年6月6日”。但是这里的输入是2013年6月19日,渲染器的输出日期是2014年7月6日。格式正确,输出日期与输入日期不同。 –
告诉我正确的输入格式,无论是19/6/2013还是2013年6月19日? – Hariharan