From 6ea48a4bd87c8a62c715a663fe53d4ff32348182 Mon Sep 17 00:00:00 2001 From: Jannik Date: Wed, 22 Jan 2020 20:29:26 +0100 Subject: [PATCH 1/3] Add: thousands_sep filter From https://stackoverflow.com/a/2901298/3944068 --- src/components/FeedItem.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/FeedItem.vue b/src/components/FeedItem.vue index 59e5915..bceecc5 100644 --- a/src/components/FeedItem.vue +++ b/src/components/FeedItem.vue @@ -10,7 +10,7 @@ color="grey darken-4 white--text transparent" label > - {{ entry.views }} views + {{ entry.views | thousands_sep }} views {{ entry.title }} @@ -27,5 +27,11 @@ export default { return `https://www.invidio.us/watch?v=${this.entry.id}`; }, }, + filters: { + thousands_sep(number) { + // return number; + return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); + }, + }, }; From 4c77b5a6dbfbd6d6a55cf83389dcc0764e84a361 Mon Sep 17 00:00:00 2001 From: Jannik Date: Thu, 23 Jan 2020 13:46:32 +0100 Subject: [PATCH 2/3] Remove debug comment --- src/components/FeedDialog.vue | 2 ++ src/components/FeedItem.vue | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/FeedDialog.vue b/src/components/FeedDialog.vue index a1b443f..ffe6efe 100644 --- a/src/components/FeedDialog.vue +++ b/src/components/FeedDialog.vue @@ -16,6 +16,8 @@ Add Channel Feed + Use Channel IDs Use usernames
+ diff --git a/src/components/FeedItem.vue b/src/components/FeedItem.vue index bceecc5..ab18638 100644 --- a/src/components/FeedItem.vue +++ b/src/components/FeedItem.vue @@ -29,7 +29,6 @@ export default { }, filters: { thousands_sep(number) { - // return number; return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); }, }, From ee56e2145f58e1f5bf8f3757e5cec535589eef78 Mon Sep 17 00:00:00 2001 From: Jannik Date: Thu, 23 Jan 2020 13:50:43 +0100 Subject: [PATCH 3/3] Remove unwanted foo --- src/components/FeedDialog.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/FeedDialog.vue b/src/components/FeedDialog.vue index ffe6efe..a1b443f 100644 --- a/src/components/FeedDialog.vue +++ b/src/components/FeedDialog.vue @@ -16,8 +16,6 @@ Add Channel Feed - Use Channel IDs Use usernames
-