mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix(ui): handle +00:00 timezone in formatTimestamp
This commit is contained in:
parent
8ec369a704
commit
623d2a12cc
1 changed files with 1 additions and 2 deletions
|
|
@ -67,8 +67,7 @@ function sourceIcon(kind) {
|
|||
|
||||
function formatTimestamp(value) {
|
||||
if (!value) return "";
|
||||
// value is an ISO-8601 string from SQLite; display as "YYYY-MM-DD HH:MM"
|
||||
const d = new Date(value.endsWith("Z") ? value : value + "Z");
|
||||
const d = new Date(value);
|
||||
if (isNaN(d)) return value;
|
||||
const pad = (n) => String(n).padStart(2, "0");
|
||||
return `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue