aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2025-11-15 21:40:27 +0100
committerнаб <nabijaczleweli@nabijaczleweli.xyz>2025-11-15 21:41:22 +0100
commit1cce66f866d0128097e305084cc65d901921ed3b (patch)
treef4d2ffd6a3ddf9204daa22c7c31620fbbce04d9a /js
parentb9eea25e52a5bff5374b09bf31db2cf345ffb76c (diff)
downloadmonzero-gui-1cce66f866d0128097e305084cc65d901921ed3b.tar.gz
monzero-gui-1cce66f866d0128097e305084cc65d901921ed3b.tar.xz
monzero-gui-1cce66f866d0128097e305084cc65d901921ed3b.zip
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
Diffstat (limited to 'js')
-rw-r--r--js/Utils.js2
1 files changed, 1 insertions, 1 deletions
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 '<delta> [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))