mirror of
https://github.com/andrey271192/amnezia_web-PRO.git
synced 2026-09-20 14:42:00 +00:00
feat(ui): show server and browser date/time in toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
18
server.js
18
server.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user