mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 00:41:16 +08:00
FIX: removes time from date in calendar range at midnight (#10751)
This commit is contained in:
@ -188,12 +188,16 @@ export default class LocalDateBuilder {
|
||||
);
|
||||
|
||||
if (inCalendarRange && sameTimezone) {
|
||||
return localDate
|
||||
.datetimeWithZone(this.localTimezone)
|
||||
.calendar(
|
||||
moment.tz(localDate.timezone),
|
||||
this._calendarFormats(this.time ? this.time : null)
|
||||
);
|
||||
const date = localDate.datetimeWithZone(this.localTimezone);
|
||||
|
||||
if (date.hours() === 0 && date.minutes() === 0) {
|
||||
return date.format("dddd");
|
||||
}
|
||||
|
||||
return date.calendar(
|
||||
moment.tz(localDate.timezone),
|
||||
this._calendarFormats(this.time ? this.time : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user