From 2e0d3d3e74b3d95cd20a80c048a7d641355e07c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= <cda@rootkey.co.uk>
Date: Tue, 21 Jul 2020 14:33:41 +0100
Subject: [PATCH] Add time ago fix

---
 changes/changelog.d/1089.bugfix            | 1 +
 front/src/components/audio/ChannelCard.vue | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 changes/changelog.d/1089.bugfix

diff --git a/changes/changelog.d/1089.bugfix b/changes/changelog.d/1089.bugfix
new file mode 100644
index 0000000000..bc3b774391
--- /dev/null
+++ b/changes/changelog.d/1089.bugfix
@@ -0,0 +1 @@
+Make channel card updated times more humanly readable, add internationalization (#1089)
\ No newline at end of file
diff --git a/front/src/components/audio/ChannelCard.vue b/front/src/components/audio/ChannelCard.vue
index 6b5d9afcb9..da44ef75a4 100644
--- a/front/src/components/audio/ChannelCard.vue
+++ b/front/src/components/audio/ChannelCard.vue
@@ -31,7 +31,7 @@
         class="meta ellipsis"
         :datetime="object.artist.modification_date"
         :title="updatedTitle">
-        {{ object.artist.modification_date | fromNow }}
+        %{ updatedAgo }
       </time>
       <play-button
         class="right floated basic icon"
@@ -47,6 +47,7 @@ import PlayButton from '@/components/audio/PlayButton'
 import TagsList from "@/components/tags/List"
 
 import {momentFormat} from '@/filters'
+import moment from "moment"
 
 export default {
   props: {
@@ -75,6 +76,9 @@ export default {
       let d = momentFormat(this.object.artist.modification_date)
       let message = this.$pgettext('*/*/*', 'Updated on %{ date }')
       return this.$gettextInterpolate(message, {date: d})
+    },
+    updatedAgo () {
+      return moment(this.object.artist.modification_date).fromNow()
     }
   }
 }
-- 
GitLab