mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 05:13:21 -07:00
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
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:
parent
9a6253d775
commit
5921a7d83f
1 changed files with 3 additions and 16 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue