change formatting of dates in event list mode

This commit is contained in:
2024-06-23 15:10:56 +02:00
parent 94e809c010
commit 19d3866934
3 changed files with 18 additions and 18 deletions

View File

@ -197,18 +197,16 @@ export function organizeEventsByDate(events: SingularEvent[]): EventsByDate {
return eventsByDate;
}
export function getClosestOccurrence(event: EventFragment) {
export function getFutureOccurrences(event: EventFragment): EventOccurrence[] {
const today = startOfToday();
const occurrences = event?.occurrences ?? [];
const futureOccurrences = occurrences.filter((occurrence) =>
isAfter(toLocalTime(occurrence.start), today)
);
futureOccurrences.sort(
(a, b) => parseISO(a.start).getTime() - parseISO(b.start).getTime()
);
return futureOccurrences[0];
return futureOccurrences as EventOccurrence[];
}
export function getEventPig(event: EventFragment): string | null {