diff options
| author | wakarimasen <wakarimasen@airmail.cc> | 2017-04-11 11:47:19 +0200 |
|---|---|---|
| committer | wakarimasen <wakarimasen@airmail.cc> | 2017-04-11 11:47:19 +0200 |
| commit | 66b59f2752e47a9f6349810c8de6d2947d811de0 (patch) | |
| tree | 5e4f84fa14fcd283cb7635b98c9eec0db6dec981 /src | |
| parent | 7ee87c7618bfba986ec7a04581273629a1db9983 (diff) | |
Fix daily average on accounts younger than a day
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 5 |
1 files changed, 2 insertions, 3 deletions
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: { |
