Skip to content
Snippets Groups Projects
Commit fe508202 authored by wakarimasen's avatar wakarimasen
Browse files

Add a daily post average to the user card

parent 9e424726
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@
<div class="user-counts">
<div class="user-count">
<h5>Statuses</h5>
<span>{{user.statuses_count}}</span>
<span>{{user.statuses_count}} <br><span class="dailyAvg">{{dailyAvg}} per day</span></span>
</div>
<div class="user-count">
<h5>Following</h5>
......@@ -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;
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment