mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 00:55:25 +08:00
FIX: Topic entrace considered the same day of a different month as today.
This commit is contained in:
parent
14c765ef11
commit
68fca9398d
@ -1,18 +1,18 @@
|
|||||||
function entranceDate(bumpedAt, showTime) {
|
function entranceDate(dt, showTime) {
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
|
|
||||||
if (bumpedAt.getDate() === today.getDate()) {
|
if (dt.toDateString() === today.toDateString()) {
|
||||||
return moment(bumpedAt).format(I18n.t("dates.time"));
|
return moment(dt).format(I18n.t("dates.time"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bumpedAt.getYear() === today.getYear()) {
|
if (dt.getYear() === today.getYear()) {
|
||||||
// No year
|
// 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")
|
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')
|
showTime ? I18n.t('dates.long_with_year') : I18n.t('dates.long_with_year_no_time')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user