fix table html & more rigorous formatSeconds variable use

This commit is contained in:
2025-02-07 12:35:52 +01:00
parent 24e977572f
commit 23bc02f180
2 changed files with 26 additions and 24 deletions

View File

@@ -132,12 +132,12 @@
muted = false;
}
function formatSeconds(seconds) {
if (isNaN(seconds)) return 'No Data';
var sec_num = parseInt(seconds, 10);
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor(sec_num / 60) % 60;
var seconds = sec_num % 60;
function formatSeconds(totalSeconds) {
if (isNaN(totalSeconds)) return 'No Data';
totalSeconds = parseInt(totalSeconds, 10);
var hours = Math.floor(totalSeconds / 3600);
var minutes = Math.floor(totalSeconds / 60) % 60;
var seconds = totalSeconds % 60;
return [hours, minutes, seconds]
.map((v) => (v < 10 ? '0' + v : v))