diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-11-15 21:40:27 +0100 |
|---|---|---|
| committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-11-15 21:41:22 +0100 |
| commit | 1cce66f866d0128097e305084cc65d901921ed3b (patch) | |
| tree | f4d2ffd6a3ddf9204daa22c7c31620fbbce04d9a | |
| parent | b9eea25e52a5bff5374b09bf31db2cf345ffb76c (diff) | |
| download | monzero-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
| -rw-r--r-- | js/Utils.js | 2 |
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)) |
