fix typo and bad rename

This commit is contained in:
2024-07-14 01:37:38 +02:00
parent 4f9d2e2bcf
commit 246572d7d0
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ export const EventItem = ({
futureOccurrences.map((occurrence) => occurrence.start) futureOccurrences.map((occurrence) => occurrence.start)
); );
const numOccurrences = event?.occurrences?.length ?? 0; const numOccurrences = event?.occurrences?.length ?? 0;
const nextOccurrence = numOccurrences ? groupedOccurrences[0] : null; const nextOccurrence = numOccurrences ? futureOccurrences[0] : null;
const featuredImage: any = event.featuredImage; const featuredImage: any = event.featuredImage;
return ( return (

View File

@ -59,7 +59,7 @@ export function compareDates(a: Date | string, b: Date | string) {
return compareAsc(new Date(a), new Date(b)); 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); const nextDay = addDays(a, 1);
return isSameDay(nextDay, b); return isSameDay(nextDay, b);
} }
@ -71,7 +71,7 @@ export function groupConsecutiveDates(dates: string[]): string[][] {
for (let i = 0; i < dates.length; i++) { for (let i = 0; i < dates.length; i++) {
if ( if (
i === 0 || i === 0 ||
isConsectutiveDays(toLocalTime(dates[i - 1]), toLocalTime(dates[i])) isConsecutiveDays(toLocalTime(dates[i - 1]), toLocalTime(dates[i]))
) { ) {
group.push(dates[i]); group.push(dates[i]);
} else { } else {