fix: Error loading calender when transport has no date

This commit is contained in:
Lars Lehmann
2025-01-23 21:29:49 +01:00
parent 12a6429812
commit 69967b759f

View File

@@ -90,12 +90,14 @@
if (transportations) {
dates = dates.concat(
transportations.map((transportation) => ({
id: transportation.id,
start: transportation.date || '', // Ensure it's a string
end: transportation.end_date || transportation.date || '', // Ensure it's a string
title: transportation.name + (transportation.type ? ` (${transportation.type})` : '')
}))
transportations
.filter((i) => i.date)
.map((transportation) => ({
id: transportation.id,
start: transportation.date || '', // Ensure it's a string
end: transportation.end_date || transportation.date || '', // Ensure it's a string
title: transportation.name + (transportation.type ? ` (${transportation.type})` : '')
}))
);
}