13位与10位时间戳转换
filters: { //vue过滤器
//时间戳改变
timechange: function (value) { //13位时间戳
var date = new Date(value);
const Y = date.getFullYear() + '-';
const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
const m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';
const s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
return (Y+M+D+h+m+s);
},
//10位时间戳
timechange: function (value) {
var date = new Date(value);
const Y = date.getFullYear() + '年';
const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '月';
const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + '日';
return (Y+M+D);
},
},