From 258fbbb987ed738c76c5c8d05dcc3cdfbbc06406 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 28 Nov 2026 09:10:53 +0100 Subject: fix(vm): a snapshot with no time shows no age, not "just now" Co-Authored-By: Claude Opus 5.5 --- static/modules/vm.js | 1 + 1 file changed, 1 insertion(+) (limited to 'static/modules/vm.js') diff --git a/static/modules/vm.js b/static/modules/vm.js index b6c1a92..c8e9676 100644 --- a/static/modules/vm.js +++ b/static/modules/vm.js @@ -57,6 +57,7 @@ function powerFor(st) { } function ago(sec) { + if (!Number.isFinite(sec) || sec <= 0) return ""; // no time is not "just now" const s = Math.max(0, Date.now() / 1000 - sec); for (const [n, u] of [[31536000, "y"], [2592000, "mo"], [86400, "d"], [3600, "h"], [60, "min"]]) { if (s >= n) return `${Math.floor(s / n)} ${u} ago`; -- cgit v1.2.3