前端寫入? :? {{item.end_time | formatData}}
調用的方法:
filters: {
//過濾器 用于格式化時間
formatData(value) {
var date = new Date(parseInt(value + '000'));
//date.setTime(value);
var month = date.getMonth() + 1;
var hours = date.getHours();
if (hours < 10)
hours = "0" + hours;
var minutes = date.getMinutes();
if (minutes < 10)
minutes = "0" + minutes;
var time = date.getFullYear() + "-" + month + "-" + date.getDate() +
" " + hours + ":" + minutes;
return time;
}
}