mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update ProfileDirectory
This commit is contained in:
parent
cfaa248c72
commit
87668d809a
2 changed files with 1 additions and 17 deletions
2
resources/assets/js/app.js
vendored
2
resources/assets/js/app.js
vendored
|
@ -73,7 +73,7 @@ window.App.util = {
|
||||||
timeAgo: (function(ts) {
|
timeAgo: (function(ts) {
|
||||||
let date = Date.parse(ts);
|
let date = Date.parse(ts);
|
||||||
let seconds = Math.floor((new Date() - date) / 1000);
|
let seconds = Math.floor((new Date() - date) / 1000);
|
||||||
let interval = Math.floor(seconds / 31536000);
|
let interval = Math.floor(seconds / 63072000);
|
||||||
if (interval >= 1) {
|
if (interval >= 1) {
|
||||||
return interval + "y";
|
return interval + "y";
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,6 @@
|
||||||
<span>
|
<span>
|
||||||
<span>{{prettyCount(profile.statuses_count)}}</span> POSTS
|
<span>{{prettyCount(profile.statuses_count)}}</span> POSTS
|
||||||
</span>
|
</span>
|
||||||
<span>
|
|
||||||
<span>{{postsPerDay(profile)}}</span> POSTS/DAY
|
|
||||||
</span>
|
|
||||||
<span>
|
<span>
|
||||||
<span>{{prettyCount(profile.followers_count)}}</span> FOLLOWERS
|
<span>{{prettyCount(profile.followers_count)}}</span> FOLLOWERS
|
||||||
</span>
|
</span>
|
||||||
|
@ -105,19 +102,6 @@
|
||||||
|
|
||||||
thumbUrl(p) {
|
thumbUrl(p) {
|
||||||
return p.media_attachments[0].url;
|
return p.media_attachments[0].url;
|
||||||
},
|
|
||||||
|
|
||||||
postsPerDay(profile) {
|
|
||||||
let created = profile.created_at;
|
|
||||||
let now = Date.now();
|
|
||||||
let diff = Math.abs(created, now)
|
|
||||||
let day = 1000 * 60 * 60 * 24;
|
|
||||||
let days = Math.round(diff / day);
|
|
||||||
|
|
||||||
let statuses = profile.statuses_count;
|
|
||||||
|
|
||||||
let perDay = this.prettyCount(Math.floor(statuses / days));
|
|
||||||
return perDay;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue