Utils.js simplify ago func

This commit is contained in:
backfire-monism-net 2023-02-01 00:35:13 -08:00
parent b7ba9437d8
commit 7d2f2cacbf
No known key found for this signature in database

View file

@ -57,12 +57,12 @@ function ago(epoch) {
if(delta < 60)
return qsTr("%n second(s) ago", "0", Math.floor(delta))
else if (delta >= 60 && delta <= 3600)
else if (delta < 3600)
return qsTr("%n minute(s) ago", "0", Math.floor(delta / 60))
else if (delta >= 3600 && delta <= 86400)
return qsTr("%n hour(s) ago", "0", Math.floor(delta / 60 / 60))
else if (delta >= 86400)
return qsTr("%n day(s) ago", "0", Math.floor(delta / 24 / 60 / 60))
else if (delta < 86400)
return qsTr("%n hour(s) ago", "0", Math.floor(delta / 3600))
else
return qsTr("%n day(s) ago", "0", Math.floor(delta / 86400))
}
function netTypeToString(){