mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
make sure relativeTime doesn't display negative values
This commit is contained in:
@@ -56,6 +56,10 @@
|
|||||||
var now = +new Date(),
|
var now = +new Date(),
|
||||||
difference = now - Math.floor(parseFloat(timestamp));
|
difference = now - Math.floor(parseFloat(timestamp));
|
||||||
|
|
||||||
|
if(difference < 0) {
|
||||||
|
difference = 0;
|
||||||
|
}
|
||||||
|
|
||||||
difference = Math.floor(difference / 1000);
|
difference = Math.floor(difference / 1000);
|
||||||
|
|
||||||
if (difference < 60) {
|
if (difference < 60) {
|
||||||
|
|||||||
Reference in New Issue
Block a user