diff --git a/static/client.js b/static/client.js index abc634a..d8d5be8 100644 --- a/static/client.js +++ b/static/client.js @@ -50,4 +50,23 @@ document.addEventListener("DOMContentLoaded", async () => { }; refreshStatus(); setInterval(refreshStatus, 60_000); // Refresh every minute -}); \ No newline at end of file +}); +const formatDate = (date) => new Intl.DateTimeFormat('en-US', { + month: 'long', + day: 'numeric', + year: 'numeric', + hour: 'numeric', + minute: '2-digit', + hour12: true +}).format(date); + +const findClosestPoint = (logs, t, maxDistance=Infinity) => { + let best; + for(let log of logs) { + let d = Math.abs(log.t-t); + if(d <= maxDistance && (!best || d