From 66b59f2752e47a9f6349810c8de6d2947d811de0 Mon Sep 17 00:00:00 2001
From: wakarimasen <wakarimasen@airmail.cc>
Date: Tue, 11 Apr 2017 11:47:19 +0200
Subject: Fix daily average on accounts younger than a day

---
 src/components/user_card_content/user_card_content.vue | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src/components/user_card_content/user_card_content.vue')

diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue
index 8c971d53..7b89a7f2 100644
--- a/src/components/user_card_content/user_card_content.vue
+++ b/src/components/user_card_content/user_card_content.vue
@@ -79,9 +79,8 @@
         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))
-        )
+        const days = Math.ceil((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000))
+        return Math.round(this.user.statuses_count / days)
       }
     },
     methods: {
-- 
cgit v1.2.3-70-g09d2

