Add check for missing start dates in calendar event loading
This commit is contained in:
@@ -21,12 +21,14 @@ export const load = (async (event) => {
|
|||||||
}> = [];
|
}> = [];
|
||||||
adventures.forEach((adventure) => {
|
adventures.forEach((adventure) => {
|
||||||
adventure.visits.forEach((visit) => {
|
adventure.visits.forEach((visit) => {
|
||||||
dates.push({
|
if (visit.start_date) {
|
||||||
id: adventure.id,
|
dates.push({
|
||||||
start: visit.start_date,
|
id: adventure.id,
|
||||||
end: visit.end_date || visit.start_date,
|
start: visit.start_date,
|
||||||
title: adventure.name + (adventure.category?.icon ? ' ' + adventure.category.icon : '')
|
end: visit.end_date || visit.start_date,
|
||||||
});
|
title: adventure.name + (adventure.category?.icon ? ' ' + adventure.category.icon : '')
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user