mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: removes time from date in calendar range at midnight (#10751)
This commit is contained in:
parent
4edb769ef2
commit
2b254f4305
2 changed files with 19 additions and 7 deletions
|
@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue