import Vue from 'vue' import dayjs from 'dayjs' import 'dayjs/locale/fr' dayjs.locale('fr') Vue.filter('formatDate', (val) => { return dayjs(val*1000).format('D MMMM YYYY') }) Vue.filter('dateStatus', (val) => { const diff = val - dayjs().unix() switch (true) { case diff<5184000: return 'warning' case diff>=5184000: return 'success' } })