Skip to content

Commit

Permalink
fix: single all day events not showing as all day in some circumstances
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Sep 7, 2023
1 parent 85be60c commit 0e90793
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/event.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 0e90793

Please sign in to comment.