@vue 日期过滤器
/*
全局时间过滤器
使用方法 e.g {
{ [item.EntityEndTime,‘yyyy-MM-dd’] | Date}}
*/
Vue.filter(‘Date’, (item) => {
const oDate = new Date(item[0]);
const o = {
‘M+’: oDate.getMonth() + 1, // 月份
‘d+’: oDate.getDate(), // 日
‘h+’: oDate.getHours(), // 小时
‘m+’: oDate.getMinutes(), // 分
‘s+’: oDate.getSeconds(), // 秒
‘q+’: Math.floor((oDate.getMonth() + 3) / 3), // 季度
S: oDate.getMilliseconds(), // 毫秒
};
// eslint-disable-next-line no-restricted-syntax
if (/(y+)/.test(item[1])) { item[1] = item[1].replace(RegExp. 1 , ( ‘ 1, (`