()
| 74 | } |
| 75 | |
| 76 | function updateClock() { |
| 77 | const d = new Date() |
| 78 | const hh = String(d.getHours()).padStart(2, '0') |
| 79 | const mm = String(d.getMinutes()).padStart(2, '0') |
| 80 | const ss = String(d.getSeconds()).padStart(2, '0') |
| 81 | |
| 82 | if (clockTime) clockTime.textContent = `${hh}:${mm}:${ss}` |
| 83 | if (clockDate) clockDate.textContent = formatDate(d) |
| 84 | } |
| 85 | |
| 86 | clockInterval = setInterval(updateClock, 1000) |
| 87 | updateClock() |
no test coverage detected