From 319a2e35bbf24128672ceb9685bcc959cf9a5a81 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Sun, 16 Aug 2020 13:22:28 +0200 Subject: [PATCH] feat: add formatDate filter --- src/main.ts | 7 +++++++ src/views/Admin/OrganizationList.vue | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index c328ab2..521a524 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,6 +20,13 @@ Vue.use(apitator, { Vue.filter('less', (s: string, l = 60) => { return s.substr(0, l) + (s.length > 60 ? '...' : '') }) +Vue.filter('formatDate', (s: string) => { + if (s == null) { + return '' + } + const d = new Date(s) + return d.toLocaleString('fr-FR', { timeZone: 'Europe/Paris' }) +}) Vue.use(TiptapVuetifyPlugin, { vuetify, iconsGroup: 'md' diff --git a/src/views/Admin/OrganizationList.vue b/src/views/Admin/OrganizationList.vue index add2643..4daf95a 100644 --- a/src/views/Admin/OrganizationList.vue +++ b/src/views/Admin/OrganizationList.vue @@ -273,7 +273,7 @@ update - {{ toSeeItem.createdAt }} + {{ toSeeItem.createdAt|formatDate }} Date de création @@ -282,7 +282,7 @@ - {{ toSeeItem.updatedAt }} + {{ toSeeItem.updatedAt|formatDate }} Date de dernière mise à jour @@ -292,7 +292,7 @@ - {{ toSeeItem.publishedAt }} + {{ toSeeItem.publishedAt|formatDate }} Date de dernière publication