diff --git a/web/src/components/events/EventItem.tsx b/web/src/components/events/EventItem.tsx index 64e8645..befaace 100644 --- a/web/src/components/events/EventItem.tsx +++ b/web/src/components/events/EventItem.tsx @@ -31,7 +31,7 @@ export const EventItem = ({ futureOccurrences.map((occurrence) => occurrence.start) ); const numOccurrences = event?.occurrences?.length ?? 0; - const nextOccurrence = numOccurrences ? groupedOccurrences[0] : null; + const nextOccurrence = numOccurrences ? futureOccurrences[0] : null; const featuredImage: any = event.featuredImage; return ( diff --git a/web/src/lib/date.ts b/web/src/lib/date.ts index 21103f5..56648a2 100644 --- a/web/src/lib/date.ts +++ b/web/src/lib/date.ts @@ -59,7 +59,7 @@ export function compareDates(a: Date | string, b: Date | string) { return compareAsc(new Date(a), new Date(b)); } -export function isConsectutiveDays(a: Date, b: Date): boolean { +export function isConsecutiveDays(a: Date, b: Date): boolean { const nextDay = addDays(a, 1); return isSameDay(nextDay, b); } @@ -71,7 +71,7 @@ export function groupConsecutiveDates(dates: string[]): string[][] { for (let i = 0; i < dates.length; i++) { if ( i === 0 || - isConsectutiveDays(toLocalTime(dates[i - 1]), toLocalTime(dates[i])) + isConsecutiveDays(toLocalTime(dates[i - 1]), toLocalTime(dates[i])) ) { group.push(dates[i]); } else {