mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add props diffNow, add computed dateString
This commit is contained in:
parent
0bba201d33
commit
54b7e58a5e
@ -2,12 +2,11 @@
|
||||
<div class="date-row">
|
||||
<b-row>
|
||||
<b-col cols="5">
|
||||
<div class="text-right">{{ $t('form.date') }}</div>
|
||||
<div class="text-right">{{ diffNow ? $t('gdd_per_link.expired') : $t('form.date') }}</div>
|
||||
</b-col>
|
||||
<b-col cols="7">
|
||||
<div class="gdd-transaction-list-item-date">
|
||||
{{ $d(new Date(balanceDate), 'long') }}
|
||||
{{ $i18n.locale === 'de' ? 'Uhr' : '' }}
|
||||
{{ dateString }}
|
||||
</div>
|
||||
</b-col>
|
||||
</b-row>
|
||||
@ -17,10 +16,22 @@
|
||||
export default {
|
||||
name: 'DateRow',
|
||||
props: {
|
||||
balanceDate: {
|
||||
date: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
diffNow: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
dateString() {
|
||||
return this.diffNow
|
||||
? this.$moment(this.date).locale(this.$i18n.locale).fromNow()
|
||||
: this.$d(new Date(this.date), 'long')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user