Skip to content

Commit 1c79b93

Browse files
committed
Add hours to represent
1 parent 115c268 commit 1c79b93

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

templates/queue.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,23 @@ <h1>
412412
});
413413

414414
function formatElapsedTime(ms) {
415-
const minutes = Math.floor(ms / 60000);
416-
if (minutes > 0) {
417-
return ` (${minutes}m)`;
418-
}
419-
return '';
415+
const totalSeconds = Math.floor(ms / 1000);
416+
const hours = Math.floor(totalSeconds / 3600);
417+
const remainingSeconds = totalSeconds % 3600;
418+
const minutes = Math.floor(remainingSeconds / 60);
419+
420+
let output = '';
421+
if (hours > 0) {
422+
output += `${hours}h`;
423+
}
424+
425+
if (minutes > 0) {
426+
output += `${minutes}m`;
427+
}
428+
if (output.length > 0) {
429+
return ` (${output})`;
430+
}
431+
return '';
420432
}
421433

422434
function updateElapsedTimes() {

0 commit comments

Comments
 (0)