mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
Change default sig of human duration function
This commit is contained in:
parent
4d37f2bab2
commit
881f37f731
5 changed files with 18 additions and 12 deletions
|
@ -354,7 +354,7 @@ function millisecondsToMinutes(ms, roundToMinute) {
|
|||
}
|
||||
}
|
||||
|
||||
function humanDuration(ms, sig='dhms', units='ms') {
|
||||
function humanDuration(ms, sig='dhm', units='ms', return_seconds=300000) {
|
||||
var factors = {
|
||||
d: 86400000,
|
||||
h: 3600000,
|
||||
|
@ -367,6 +367,10 @@ function humanDuration(ms, sig='dhms', units='ms') {
|
|||
var d, h, m, s;
|
||||
|
||||
if (ms > 0) {
|
||||
if (return_seconds && ms < return_seconds) {
|
||||
sig = 'dhms'
|
||||
}
|
||||
|
||||
ms = ms * factors[units];
|
||||
|
||||
h = ms % factors['d'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue