Fix rounding of minutes in global stats play duration
Some checks failed
CodeQL / CodeQL Analysis (push) Has been cancelled
Publish Docker / Build Docker Image (push) Has been cancelled
Publish Installers / Build MacOS Installer (push) Has been cancelled
Publish Installers / Build Windows Installer (push) Has been cancelled
Publish Snap / Build Snap Package (amd64) (push) Has been cancelled
Publish Snap / Build Snap Package (arm64) (push) Has been cancelled
Publish Snap / Build Snap Package (armhf) (push) Has been cancelled
Publish Docker / Discord Notification (push) Has been cancelled
Publish Installers / VirusTotal Scan (push) Has been cancelled
Publish Installers / Release Installers (push) Has been cancelled
Publish Installers / Discord Notification (push) Has been cancelled
Publish Snap / Discord Notification (push) Has been cancelled

This commit is contained in:
JonnyWong16 2025-07-14 19:54:45 -07:00
commit 5921a7d83f
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -288,23 +288,10 @@ function isPrivateIP(ip_address) {
}
function humanTime(seconds) {
var d = Math.floor(moment.duration(seconds, 'seconds').asDays());
var h = Math.floor(moment.duration((seconds % 86400), 'seconds').asHours());
var m = Math.round(moment.duration(((seconds % 86400) % 3600), 'seconds').asMinutes());
var text = '';
if (d > 0) {
text = '<h3>' + d + '</h3><p> day' + ((d > 1) ? 's' : '') + '</p>'
+ '<h3>' + h + '</h3><p> hr' + ((h > 1) ? 's' : '') + '</p>'
+ '<h3>' + m + '</h3><p> min' + ((m > 1) ? 's' : '') + '</p>';
} else if (h > 0) {
text = '<h3>' + h + '</h3><p> hr' + ((h > 1) ? 's' : '') + '</p>'
+ '<h3>' + m + '</h3><p> min' + ((m > 1) ? 's' : '') + '</p>';
} else {
text = '<h3>' + m + '</h3><p> min' + ((m > 1) ? 's' : '') + '</p>';
if (seconds > 0) {
return humanDuration(seconds * 1000).replaceAll(/(\d+) (\w+)/g, '<h3>$1</h3><p>$2</p>')
}
return text
return "<h3>0</h3><p>mins</p>";
}
String.prototype.toProperCase = function () {