Skip to content

Commit

Permalink
fix: nan showing for events that are not split
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Sep 13, 2023
1 parent 6c87ff3 commit 151a03b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/common.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function getMultiDayEventParts(config: atomicCardConfig, event: EventClas
}
if (config.showMultiDayEventParts === true && event.addDays === false && event.daysLong) {
const daysSinceStart = dayjs(event.rawEvent._startDateTime, 'YYYY-MM-DD').diff(event.startDateTime, 'day')
return html`(${daysSinceStart}/${event.daysLong})`
return html`(${Number.isNaN(daysSinceStart) ? 1 : daysSinceStart}/${event.daysLong})`
}

}
Expand Down

0 comments on commit 151a03b

Please sign in to comment.