Merge pull request #469 from gradido/fix-datetime-format

fix: Date Time Formats
This commit is contained in:
Moriz Wahl 2021-05-27 14:06:26 +02:00 committed by GitHub
commit fd172e5731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 3 deletions

View File

@ -48,9 +48,43 @@ const numberFormats = {
},
}
const dateTimeFormats = {
en: {
short: {
year: 'numeric',
month: 'numeric',
day: 'numeric',
},
long: {
year: 'numeric',
month: 'short',
day: 'numeric',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
},
},
de: {
short: {
day: 'numeric',
month: 'numeric',
year: 'numeric',
},
long: {
day: 'numeric',
month: 'short',
year: 'numeric',
weekday: 'short',
hour: 'numeric',
minute: 'numeric',
},
},
}
export default new VueI18n({
locale: 'en',
fallbackLocale: 'en',
messages: loadLocaleMessages(),
numberFormats,
dateTimeFormats,
})

View File

@ -16,8 +16,7 @@
<b-badge variant="primary" pill>{{ $t('form.message') }}</b-badge>
</b-list-group-item>
<b-list-group-item class="d-flex justify-content-between align-items-center">
{{ date }}
{{ $moment(date).format('DD.MM.YYYY - HH:mm:ss') }}
{{ $d($moment(date), 'long') }}
<b-badge variant="primary" pill>{{ $t('form.date') }}</b-badge>
</b-list-group-item>
</b-list-group>

View File

@ -17,7 +17,7 @@
<div class="font1_2em text-left pl-2" style="width: 65%">
{{ item.name }}
<small>{{ item.name ? '' : $t('decay') }}</small>
<div class="text-sm">{{ $moment(item.date).format('DD.MM.YYYY - HH:mm:ss') }}</div>
<div v-if="item.date" class="text-sm">{{ $d($moment(item.date), 'long') }}</div>
</div>
<div class="text-right" style="width: 5%">
<b-button class="btn-sm">