From 88890f816fbc00852c3a21b794e743c5e4e76804 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Mon, 6 Apr 2026 22:24:38 -0700 Subject: [PATCH] Fix download history timestamps always showing 'Just now' SQLite CURRENT_TIMESTAMP stores UTC but the format lacks a timezone marker. JavaScript parsed it as local time, causing future-dated timestamps and negative diffs that always fell into 'Just now'. Normalize by appending 'Z' to mark as UTC before parsing. --- webui/static/script.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webui/static/script.js b/webui/static/script.js index c424068d..02474737 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -21177,7 +21177,12 @@ function renderHistoryEntry(entry) { function formatHistoryTime(isoStr) { if (!isoStr) return ''; try { - const date = new Date(isoStr); + // SQLite CURRENT_TIMESTAMP is UTC but lacks timezone marker — append Z + let normalized = isoStr; + if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/.test(normalized) && !normalized.includes('Z') && !normalized.includes('+')) { + normalized = normalized.replace(' ', 'T') + 'Z'; + } + const date = new Date(normalized); const now = new Date(); const diffMs = now - date; const diffMins = Math.floor(diffMs / 60000);