From 68fca9398dbb4feff83167b8921049cbaf052836 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 18 Aug 2014 17:40:50 -0400 Subject: [PATCH] FIX: Topic entrace considered the same day of a different month as today. --- .../discourse/controllers/topic-entrance.js.es6 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic-entrance.js.es6 b/app/assets/javascripts/discourse/controllers/topic-entrance.js.es6 index 26bb1e957..074d856b9 100644 --- a/app/assets/javascripts/discourse/controllers/topic-entrance.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic-entrance.js.es6 @@ -1,18 +1,18 @@ -function entranceDate(bumpedAt, showTime) { +function entranceDate(dt, showTime) { var today = new Date(); - if (bumpedAt.getDate() === today.getDate()) { - return moment(bumpedAt).format(I18n.t("dates.time")); + if (dt.toDateString() === today.toDateString()) { + return moment(dt).format(I18n.t("dates.time")); } - if (bumpedAt.getYear() === today.getYear()) { + if (dt.getYear() === today.getYear()) { // No year - return moment(bumpedAt).format( + return moment(dt).format( showTime ? I18n.t("dates.long_no_year") : I18n.t("dates.long_no_year_no_time") ); } - return moment(bumpedAt).format( + return moment(dt).format( showTime ? I18n.t('dates.long_with_year') : I18n.t('dates.long_with_year_no_time') ); }