change formatting of dates in event list mode
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user