General improvements to postlist and post

This commit is contained in:
riggraz
2019-09-21 11:17:58 +02:00
parent 38345f9c42
commit 7874015580
11 changed files with 25 additions and 13 deletions

View File

@@ -5,8 +5,7 @@ const friendlyDate = date => {
var secondsPast = (now.getTime() - timeStamp.getTime()) / 1000;
if (secondsPast < 60) {
secondsPast = parseInt(secondsPast);
return secondsPast + ' ' + (secondsPast === 1 ? 'second' : 'seconds') + ' ago';
return 'just now';
} else if (secondsPast < 3600) {
let minutesPast = parseInt(secondsPast / 60);
return minutesPast + ' ' + (minutesPast === 1 ? 'minute' : 'minutes') + ' ago';