fix table html & more rigorous formatSeconds variable use
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
<div id="table-container">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Timestamp</th><th>Artist</th><th>Title</th></tr>
|
||||
{#each $currentStream.tracks as track, i}
|
||||
<tr class:current={i == $currentSongIndex}>
|
||||
@@ -48,6 +49,7 @@
|
||||
<td class="track-field">{track[2]}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user