From 1cce66f866d0128097e305084cc65d901921ed3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sat, 15 Nov 2025 21:40:27 +0100 Subject: [PATCH] Don't try negative numbers when translating "%n second(s) ago"-style strings When the local clock is running behind, transactions may appear to have been confirmed in the future, which seems to leave the %n in "%n second(s) ago" unreplaced, so round negative times ago to 0 Ref: #3284 --- js/Utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/Utils.js b/js/Utils.js index cf8015af..9094ca4f 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -53,7 +53,7 @@ function ago(epoch) { // Returns ' [seconds|minutes|hours|days] ago' string given an epoch var now = new Date().getTime() / 1000; - var delta = now - epoch; + var delta = Math.max(now - epoch, 0); if(delta < 60) return qsTr("%n second(s) ago", "0", Math.floor(delta))