From 7c09053ce1bcbd592ec4427dc0904fe292ce491a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 11:55:04 -1000 Subject: Clamp negative ages in the age refresher --- assets/cgit.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/cgit.js b/assets/cgit.js index 4a0d088..ddb86f5 100644 --- a/assets/cgit.js +++ b/assets/cgit.js @@ -47,6 +47,12 @@ function aging() { for (m = 0; m < elems.length; m++) { var age = now_ut - elems[m].getAttribute("data-ut"); + /* A commit dated ahead of the viewer's clock would + * otherwise render as a negative age; ui-shared.c + * clamps the same way. */ + if (age < 0) + age = 0; + render_age(elems[m], age); } } -- cgit v2.8.0