feat: add formatDate filter

This commit is contained in:
Matthieu Bessat 2020-08-16 13:22:28 +02:00
parent 5139871d8d
commit 319a2e35bb
2 changed files with 10 additions and 3 deletions

View file

@ -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'

View file

@ -273,7 +273,7 @@
<v-icon>update</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ toSeeItem.createdAt }}</v-list-item-title>
<v-list-item-title>{{ toSeeItem.createdAt|formatDate }}</v-list-item-title>
<v-list-item-subtitle>Date de création</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
@ -282,7 +282,7 @@
<v-list-item>
<v-list-item-action />
<v-list-item-content>
<v-list-item-title>{{ toSeeItem.updatedAt }}</v-list-item-title>
<v-list-item-title>{{ toSeeItem.updatedAt|formatDate }}</v-list-item-title>
<v-list-item-subtitle>Date de dernière mise à jour</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
@ -292,7 +292,7 @@
<v-list-item>
<v-list-item-action />
<v-list-item-content>
<v-list-item-title>{{ toSeeItem.publishedAt }}</v-list-item-title>
<v-list-item-title>{{ toSeeItem.publishedAt|formatDate }}</v-list-item-title>
<v-list-item-subtitle>Date de dernière publication</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>