문제

I have got this time stamp: 1400000000, which is 05/13/2014. Is there a way to display this in my grid, panel or dialog as a m/d/Y.

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

Is there any way to show epoch time as dateformat?

도움이 되었습니까?

해결책

I think you can do something like this :

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') : '';
}

Hopefully that helps you!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top