This commit is contained in:
Matthias Hochmeister
2026-03-26 11:25:28 +01:00
parent 3d03345107
commit d4adf9230d
5 changed files with 181 additions and 68 deletions

View File

@@ -2056,12 +2056,13 @@ export default function Kalender() {
<Tooltip title="Als PDF exportieren">
<IconButton
size="small"
onClick={() => generatePdf(
viewMonth.year,
viewMonth.month,
trainingForMonth,
eventsForMonth,
)}
onClick={() => {
const start = new Date(viewMonth.year, viewMonth.month, 1);
const end = new Date(viewMonth.year, viewMonth.month + 1, 0, 23, 59, 59);
const trainToExport = trainingEvents.filter((t) => { const d = new Date(t.datum_von); return d >= start && d <= end; });
const eventsToExport = veranstaltungen.filter((e) => { const d = new Date(e.datum_von); return d >= start && d <= end; });
generatePdf(viewMonth.year, viewMonth.month, trainToExport, eventsToExport);
}}
>
<PdfIcon fontSize="small" />
</IconButton>