diff --git a/pages/eventsPage.tsx b/pages/eventsPage.tsx index 93f9fc5..a1bb61a 100644 --- a/pages/eventsPage.tsx +++ b/pages/eventsPage.tsx @@ -47,6 +47,16 @@ export default function Events({ events }: Props): JSX.Element { ); }); + const uniqueEvents = Array.from( + // filters out identical events, ignoring "id" field + new Map( + filteredEvents.map((event) => [ + JSON.stringify({ ...event, id: undefined }), + event, + ]), + ).values(), + ); + return (
@@ -59,7 +69,7 @@ export default function Events({ events }: Props): JSX.Element {

Stay tuned for more events!

)} - {filteredEvents.map((event, index) => { + {uniqueEvents.map((event, index) => { const start = format(new Date(event.start), 'h:mma'); const end = format(new Date(event.end), 'h:mma'); const startDate = format(new Date(event.start), 'E MMM d');