Skip to content

Commit

Permalink
Add check for missing start dates in calendar event loading
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorley15 authored Dec 15, 2024
2 parents e029654 + 7d609d0 commit 4de6fa6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend/src/routes/calendar/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '')
});
}
});
});

Expand Down

0 comments on commit 4de6fa6

Please sign in to comment.