Angular2中的Angular2更改日期格式

时间:2017-03-09 05:02:09

标签: angularjs date ag-grid

columnDefs:any[] = [
     {headerName: 'Incident Id', field: 'incidentId'},
        {headerName: 'Time', field: '{{incidentTime |  date: \'dd/MM/yyyy\'}}'}

    ];

其中 incidentTime 的时间戳格式为1488225600000(2017年2月28日),但管道不起作用。

如何将此日期转换为require格式。

1 个答案:

答案 0 :(得分:0)

添加celltemplate并输入如下内容:

type: 'date',
cellTemplate: '{{incidentTime |  date: \'dd/MM/yyyy\'}}'