feat(ui): show server and browser date/time in toolbar

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Андрей Бобырев
2026-05-14 16:14:27 +03:00
parent 73b7d104d4
commit 1c22f89d5a
4 changed files with 116 additions and 0 deletions

View File

@@ -344,6 +344,24 @@ app.get("/api/session", (req, res) => {
res.json({ ok: true });
});
app.get("/api/server-time", requireAuth, (_req, res) => {
const now = new Date();
let timeZone = "UTC";
try {
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || timeZone;
} catch {
/* ignore */
}
res.json({
iso: now.toISOString(),
formatted: now.toLocaleString("ru-RU", {
dateStyle: "medium",
timeStyle: "medium",
}),
timeZone,
});
});
app.post("/api/login", (req, res) => {
const pw = req.body?.password;
if (typeof pw !== "string" || !pw) {