Show next scheduled sync time on every page
Exposes the scheduler's next_tick in the topbar via a safe Jinja helper (falls back to nothing if the scheduler isn't running yet), and converts the server-rendered UTC timestamp to the visitor's local time client-side so it reads correctly regardless of timezone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
10
app/web/static/app.js
Normal file
10
app/web/static/app.js
Normal file
@@ -0,0 +1,10 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
document.querySelectorAll("time[data-utc]").forEach((el) => {
|
||||
const date = new Date(el.dataset.utc);
|
||||
if (Number.isNaN(date.getTime())) {
|
||||
return;
|
||||
}
|
||||
el.textContent = date.toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" });
|
||||
el.title = `${el.dataset.utc} (UTC)`;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user