mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-01 18:17:26 -04:00
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
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user