From 7d609d01eaed4b9ed3f358bcbbaf2634f9c42bf7 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Sun, 15 Dec 2024 13:28:33 -0500 Subject: [PATCH] Add check for missing start dates in calendar event loading --- frontend/src/routes/calendar/+page.server.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/routes/calendar/+page.server.ts b/frontend/src/routes/calendar/+page.server.ts index 6c9ede0..93ce8ed 100644 --- a/frontend/src/routes/calendar/+page.server.ts +++ b/frontend/src/routes/calendar/+page.server.ts @@ -21,12 +21,14 @@ export const load = (async (event) => { }> = []; adventures.forEach((adventure) => { adventure.visits.forEach((visit) => { - dates.push({ - id: adventure.id, - start: visit.start_date, - end: visit.end_date || visit.start_date, - title: adventure.name + (adventure.category?.icon ? ' ' + adventure.category.icon : '') - }); + if (visit.start_date) { + dates.push({ + id: adventure.id, + start: visit.start_date, + end: visit.end_date || visit.start_date, + title: adventure.name + (adventure.category?.icon ? ' ' + adventure.category.icon : '') + }); + } }); });