Skip to content

Commit 47c0547

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

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/mixins/relativeDate.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
*/
55

66
import moment from '@nextcloud/moment'
7+
import { useFormatRelativeTime } from '@nextcloud/vue'
78

89
export default {
910
computed: {
1011
relativeDate() {
1112
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()
13+
return useFormatRelativeTime(timestamp)
1714
}
1815
},
1916
},

0 commit comments

Comments
 (0)