Extjs 3在时间到日期格式方面存在问题

Extjs 3在时间到日期格式方面存在问题,extjs,Extjs,我得到了这个时间戳:140000000,是2014年5月13日。有没有办法在我的网格、面板或对话框中将其显示为m/d/Y config.cm = new Ext.grid.ColumnModel({ defaults:{ sortable: true }, columns : [{ { header: 'date', dataIndex: 'time', editable:'fals

我得到了这个时间戳:140000000,是2014年5月13日。有没有办法在我的网格、面板或对话框中将其显示为m/d/Y

  config.cm =  new Ext.grid.ColumnModel({
    defaults:{
        sortable: true
    },
    columns :  [{ 
        {
        header: 'date',
        dataIndex: 'time',
        editable:'false'
    }]
});

有没有办法将纪元时间显示为日期格式?

我想您可以这样做:

config.cm =  new Ext.grid.ColumnModel({
    defaults:{
        sortable: true
    },
    columns :  [{ 
        {
        header: 'date',
        dataIndex: 'time',
        editable:'false',
        renderer: formatDate
    }]
});

function formatDate(value){
    return value ? value.dateFormat('M d, Y') : '';
}

希望这对你有帮助

我使用数据库触发器将时间戳转换为dateformat BEGIN set@@lc\u time\u names=nl\u nl;更新主_表设置时间_列=从_unixtime(NEW.start_time,'%d%M%Y'),其中model_id=NEW.id;终止