Skip to content

Node.js based forum software built for the modern web

prevent timeago in future for new posts

Barış Soner Uşaklıa513d98e1d07
diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js
index d768e2ebd7..1773357122 100644
--- a/public/src/client/topic/posts.js
+++ b/public/src/client/topic/posts.js
@@ -18,6 +18,11 @@ define('forum/topic/posts', [
data.loggedIn = !!app.user.uid;
data.privileges = ajaxify.data.privileges;
+
+ // prevent timeago in future by setting timestamp to 1 sec behind now
+ data.posts[0].timestamp = Date.now() - 1000;
+ data.posts[0].timestampISO = utils.toISOString(data.posts[0].timestamp);
+
Posts.modifyPostsByPrivileges(data.posts);
updatePostCounts(data.posts);