We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d5e0a9 commit 47c0547Copy full SHA for 47c0547
1 file changed
src/mixins/relativeDate.js
@@ -4,16 +4,13 @@
4
*/
5
6
import moment from '@nextcloud/moment'
7
+import { useFormatRelativeTime } from '@nextcloud/vue'
8
9
export default {
10
computed: {
11
relativeDate() {
12
return (timestamp) => {
- 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()
+ return useFormatRelativeTime(timestamp)
17
}
18
},
19
0 commit comments