Skip to content

Node.js based forum software built for the modern web

make sure relativeTime doesn't display negative values

Baris Soner Usakli09efb83ef36f
diff --git a/public/src/utils.js b/public/src/utils.js
index 926c05a0c5..9acc0594d9 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -56,6 +56,10 @@
var now = +new Date(),
difference = now - Math.floor(parseFloat(timestamp));
+ if(difference < 0) {
+ difference = 0;
+ }
+
difference = Math.floor(difference / 1000);
if (difference < 60) {