日期格式化
1.用在Extjs的Grid中
2.添加方法,用js來格式化
3.具體代碼如下:
renderer : function(value) {
if (value == null || value == 0) {
return ''
} else {
return Ext.util.Format.date(new Date(value), 'Y-m-d');
}
}
4.前提:你後端串過來的日期是日期類型而不是字符串類型
5.親測有效,不對之處望指正,謝謝!
6.擴展:這是js的方法