From 151a03b43678bb096eae09b338cc111028774039 Mon Sep 17 00:00:00 2001 From: marksie1988 Date: Wed, 13 Sep 2023 09:37:08 +0000 Subject: [PATCH] fix: nan showing for events that are not split --- src/lib/common.html.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/common.html.ts b/src/lib/common.html.ts index 3ba08890..59861572 100644 --- a/src/lib/common.html.ts +++ b/src/lib/common.html.ts @@ -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})` } }