aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--static/modules/vm.js1
1 files changed, 1 insertions, 0 deletions
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`;