FIX: removes time from date in calendar range at midnight (#10751)

This commit is contained in:
Joffrey JAFFEUX
2020-09-28 10:39:21 +02:00
committed by GitHub
parent 4edb769ef2
commit 2b254f4305
2 changed files with 19 additions and 7 deletions

View File

@ -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)
);
}
}