我在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