From fe5082023d28811c53733daecfe14b597a9f120a Mon Sep 17 00:00:00 2001 From: wakarimasen Date: Fri, 10 Mar 2017 21:37:13 +0100 Subject: [PATCH] Add a daily post average to the user card --- .../user_card_content/user_card_content.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 3fa34773..8c971d53 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -40,7 +40,7 @@
Statuses
- {{user.statuses_count}} + {{user.statuses_count}}
{{dailyAvg}} per day
Following
@@ -77,6 +77,11 @@ }, loggedIn () { return this.$store.state.users.currentUser + }, + dailyAvg () { + return Math.round( + this.user.statuses_count / ((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000)) + ) } }, methods: { @@ -217,4 +222,9 @@ margin: 0 0 0.25em; } } + +.dailyAvg { + font-size: 0.8em; + opacity: 0.5; +}