From 0e907937f480bfaef4759e36d16fdc9554dbf21b Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Thu, 7 Sep 2023 12:22:05 +0000 Subject: [PATCH] fix: single all day events not showing as all day in some circumstances --- src/lib/event.class.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/event.class.ts b/src/lib/event.class.ts index 84f2ee78..d4bbccb8 100644 --- a/src/lib/event.class.ts +++ b/src/lib/event.class.ts @@ -218,18 +218,20 @@ export default class EventClass { * @return {Boolean} */ get isAllDayEvent() { - const isMidnightStart = this.startDateTime.startOf('day').diff(this.startDateTime) === 0; - const isMidnightEnd = this.endDateTime.startOf('day').diff(this.endDateTime) === 0; - if (isMidnightStart && isMidnightEnd) { + // if start and end are both "date" then it's an all day event + if (this.rawEvent.start.date && this.rawEvent.end.date) { return true; } - // check for days that are between multi days - they ARE all day if (!this.isFirstDay && !this.isLastDay && this.daysLong && this._globalConfig.showMultiDay) { return true; } + // if start and end are both "dateTime" then it's NOT an all day event + if (this.rawEvent.start.dateTime && this.rawEvent.end.dateTime) { + return false + } - return isMidnightStart && isMidnightEnd; + return undefined; } /**