Skip to content

Commit 96db8e5

Browse files
committed
fix(ui): use nextcloud/vue formatRelativeTime in mixin
Signed-off-by: grnd-alt <git@belakkaf.net>
1 parent 9d5e0a9 commit 96db8e5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/mixins/relativeDate.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import moment from '@nextcloud/moment'
6+
import { useFormatRelativeTime } from '@nextcloud/vue'
77

88
export default {
99
computed: {
1010
relativeDate() {
1111
return (timestamp) => {
12-
const diff = moment(this.$root.time).diff(moment(timestamp))
13-
if (diff >= 0 && diff < 45000) {
14-
return t('core', 'seconds ago')
15-
}
16-
return moment(timestamp).fromNow()
12+
return useFormatRelativeTime(timestamp)
1713
}
1814
},
1915
},

0 commit comments

Comments
 (0)