mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-08 09:29:10 +00:00
only include direction on timestamps when required
This commit is contained in:
parent
ef41494bad
commit
804ba0cdb6
3 changed files with 15 additions and 7 deletions
|
@ -151,6 +151,7 @@
|
|||
>
|
||||
<Timeago
|
||||
:time="notification.created_at"
|
||||
:with-direction="true"
|
||||
:auto-update="240"
|
||||
/>
|
||||
</router-link>
|
||||
|
|
|
@ -187,6 +187,7 @@
|
|||
>
|
||||
<Timeago
|
||||
:time="status.created_at"
|
||||
:with-direction="true"
|
||||
:auto-update="60"
|
||||
/>
|
||||
</router-link>
|
||||
|
|
|
@ -4,12 +4,18 @@
|
|||
:title="localeDateString"
|
||||
:class="{ warning: relativeTime.direction === 'time.in_future' }"
|
||||
>
|
||||
{{
|
||||
relativeTime.direction === '' ?
|
||||
$tc(relativeTime.key, relativeTime.num, [relativeTime.num]) :
|
||||
$t(relativeTime.direction, [$tc(relativeTime.key, relativeTime.num, [relativeTime.num])])
|
||||
}}
|
||||
</time>
|
||||
<template
|
||||
v-if="withDirection"
|
||||
>
|
||||
{{
|
||||
relativeTime.direction === '' ?
|
||||
$tc(relativeTime.key, relativeTime.num, [relativeTime.num]) :
|
||||
$t(relativeTime.direction, [$tc(relativeTime.key, relativeTime.num, [relativeTime.num])])
|
||||
}}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ $tc(relativeTime.key, relativeTime.num, [relativeTime.num]) }}
|
||||
</template></time>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -18,7 +24,7 @@ import localeService from 'src/services/locale/locale.service.js'
|
|||
|
||||
export default {
|
||||
name: 'Timeago',
|
||||
props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold'],
|
||||
props: ['time', 'autoUpdate', 'longFormat', 'nowThreshold', 'withDirection'],
|
||||
data () {
|
||||
return {
|
||||
relativeTime: { key: 'time.now', num: 0 },
|
||||
|
|
Loading…
Reference in a new issue