diff --git a/frontend/src/pages/BestellungDetail.tsx b/frontend/src/pages/BestellungDetail.tsx index 1759782..6aadc79 100644 --- a/frontend/src/pages/BestellungDetail.tsx +++ b/frontend/src/pages/BestellungDetail.tsx @@ -590,14 +590,17 @@ export default function BestellungDetail() { doc.setFont('helvetica', 'normal'); doc.setTextColor(0, 0, 0); - // Ort/Datum line (left) - doc.line(10, curY, 90, curY); + // Place and date (right-aligned, above signature line) + const today = new Date(); + const dd = String(today.getDate()).padStart(2, '0'); + const mm = String(today.getMonth() + 1).padStart(2, '0'); + const yyyy = today.getFullYear(); + doc.text(`St. Valentin, am ${dd}.${mm}.${yyyy}`, 200, curY - 6, { align: 'right' }); // Signature line (right) doc.line(120, curY, 200, curY); curY += 4; - doc.text('Ort, Datum', 10, curY); const sigName = bestellung.besteller_dienstgrad ? `${kurzDienstgrad(bestellung.besteller_dienstgrad)} ${bestellung.besteller_name || ''}` : (bestellung.besteller_name || ''); diff --git a/frontend/src/pages/Kalender.tsx b/frontend/src/pages/Kalender.tsx index f003f2b..daed0b5 100644 --- a/frontend/src/pages/Kalender.tsx +++ b/frontend/src/pages/Kalender.tsx @@ -1234,6 +1234,10 @@ function VeranstaltungFormDialog({ notification.showError('Datum Bis muss nach Datum Von liegen'); return; } + if (wiederholungAktiv && !wiederholungBis) { + notification.showError('Bitte Enddatum für Wiederholung angeben'); + return; + } if (wiederholungAktiv && wiederholungBis && isNaN(new Date(wiederholungBis).getTime())) { notification.showError('Ungültiges Datum für Wiederholung Bis'); return; @@ -1326,32 +1330,64 @@ function VeranstaltungFormDialog({ } label="Ganztägig" /> - { - const d = form.ganztaegig - ? new Date(iso + 'T00:00:00') - : new Date(iso); - if (isNaN(d.getTime())) return; - handleChange('datum_von', d.toISOString()); - }} - fullWidth - /> - { - const d = form.ganztaegig - ? new Date(iso + 'T23:59:00') - : new Date(iso); - if (isNaN(d.getTime())) return; - handleChange('datum_bis', d.toISOString()); - }} - fullWidth - /> + + { + const timeStr = form.datum_von?.substring(11, 16) || '00:00'; + const d = new Date(`${isoDate}T${timeStr}:00`); + if (isNaN(d.getTime())) return; + handleChange('datum_von', d.toISOString()); + }} + sx={{ flex: 1 }} + /> + {!form.ganztaegig && ( + { + const dateStr = form.datum_von?.substring(0, 10) || new Date().toISOString().substring(0, 10); + const d = new Date(`${dateStr}T${e.target.value}:00`); + if (!isNaN(d.getTime())) handleChange('datum_von', d.toISOString()); + }} + InputLabelProps={{ shrink: true }} + inputProps={{ step: 300 }} + sx={{ width: 130 }} + /> + )} + + + { + const timeStr = form.datum_bis?.substring(11, 16) || '23:59'; + const d = new Date(`${isoDate}T${timeStr}:00`); + if (isNaN(d.getTime())) return; + handleChange('datum_bis', d.toISOString()); + }} + sx={{ flex: 1 }} + /> + {!form.ganztaegig && ( + { + const dateStr = form.datum_bis?.substring(0, 10) || new Date().toISOString().substring(0, 10); + const d = new Date(`${dateStr}T${e.target.value}:00`); + if (!isNaN(d.getTime())) handleChange('datum_bis', d.toISOString()); + }} + InputLabelProps={{ shrink: true }} + inputProps={{ step: 300 }} + sx={{ width: 130 }} + /> + )} +