Local time clock

This commit is contained in:
Ian Gulliver
2020-06-27 20:21:41 +00:00
parent 8547b88977
commit 323a7f26db
2 changed files with 13 additions and 0 deletions

View File

@@ -100,6 +100,12 @@ function renderControls(roomId, clientId, adminSecret, prnt, es) {
controls.classList.remove("enable");
}
});
const clockDiv = create(prnt, "div", "\u00a0Time: ");
const clock = create(clockDiv, "span");
setInterval(() => {
const now = new Date();
clock.innerText = `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, "0")}:${now.getSeconds().toString().padStart(2, "0")}`;
}, 250);
}
function renderAdmin(roomId, adminSecret, prnt, es) {
const table = create(prnt, "table", undefined, ["users"]);