feat: add formatDate filter
This commit is contained in:
parent
5139871d8d
commit
319a2e35bb
2 changed files with 10 additions and 3 deletions
|
@ -20,6 +20,13 @@ Vue.use(apitator, {
|
||||||
Vue.filter('less', (s: string, l = 60) => {
|
Vue.filter('less', (s: string, l = 60) => {
|
||||||
return s.substr(0, l) + (s.length > 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, {
|
Vue.use(TiptapVuetifyPlugin, {
|
||||||
vuetify,
|
vuetify,
|
||||||
iconsGroup: 'md'
|
iconsGroup: 'md'
|
||||||
|
|
|
@ -273,7 +273,7 @@
|
||||||
<v-icon>update</v-icon>
|
<v-icon>update</v-icon>
|
||||||
</v-list-item-icon>
|
</v-list-item-icon>
|
||||||
<v-list-item-content>
|
<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-subtitle>Date de création</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
@ -282,7 +282,7 @@
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-action />
|
<v-list-item-action />
|
||||||
<v-list-item-content>
|
<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-subtitle>Date de dernière mise à jour</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
@ -292,7 +292,7 @@
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-action />
|
<v-list-item-action />
|
||||||
<v-list-item-content>
|
<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-subtitle>Date de dernière publication</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
Loading…
Reference in a new issue