reoccurring event fix
This commit is contained in:
@@ -1634,13 +1634,13 @@ function VeranstaltungFormDialog({
|
||||
/>
|
||||
)}
|
||||
{/* Wiederholung */}
|
||||
{(!editingEvent || (editingEvent && editingEvent.wiederholung)) && (
|
||||
{(!editingEvent || editingEvent.wiederholung || editingEvent.wiederholung_parent_id) && (
|
||||
<>
|
||||
<Divider />
|
||||
{editingEvent && editingEvent.wiederholung && editingEvent.wiederholung_parent_id ? (
|
||||
{editingEvent?.wiederholung_parent_id ? (
|
||||
<>
|
||||
<Typography variant="body2" color="text.secondary" sx={{ fontStyle: 'italic' }}>
|
||||
Wiederholung kann nicht bearbeitet werden (Einzeltermin einer Serie)
|
||||
Dieser Termin ist Teil einer Serienveranstaltung. Änderungen betreffen nur diesen Einzeltermin.
|
||||
</Typography>
|
||||
<FormControlLabel
|
||||
control={<Switch checked disabled />}
|
||||
@@ -1652,7 +1652,14 @@ function VeranstaltungFormDialog({
|
||||
control={
|
||||
<Switch
|
||||
checked={wiederholungAktiv}
|
||||
onChange={(e) => setWiederholungAktiv(e.target.checked)}
|
||||
onChange={(e) => {
|
||||
setWiederholungAktiv(e.target.checked);
|
||||
if (e.target.checked && !wiederholungBis) {
|
||||
const bisDefault = new Date(form.datum_von);
|
||||
bisDefault.setMonth(bisDefault.getMonth() + 3);
|
||||
setWiederholungBis(bisDefault.toISOString().slice(0, 10));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
}
|
||||
label="Wiederkehrende Veranstaltung"
|
||||
|
||||
@@ -928,16 +928,20 @@ function EventFormDialog({
|
||||
fullWidth
|
||||
/>
|
||||
|
||||
{/* Recurrence / Wiederholung — for new events or when editing a parent event */}
|
||||
{(!editingEvent || (editingEvent.wiederholung && !editingEvent.wiederholung_parent_id)) && (
|
||||
{/* Recurrence / Wiederholung — for new events, parent events, or child events */}
|
||||
{(!editingEvent || editingEvent.wiederholung || editingEvent.wiederholung_parent_id) && (
|
||||
<>
|
||||
<Divider />
|
||||
{editingEvent && (
|
||||
{editingEvent?.wiederholung_parent_id ? (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ fontStyle: 'italic' }}>
|
||||
Dieser Termin ist Teil einer Serienveranstaltung. Änderungen betreffen nur diesen Einzeltermin.
|
||||
</Typography>
|
||||
) : editingEvent?.wiederholung ? (
|
||||
<Typography variant="caption" color="text.secondary">
|
||||
Änderungen an der Wiederholung werden alle bestehenden Instanzen löschen und neu generieren.
|
||||
</Typography>
|
||||
)}
|
||||
<FormControlLabel
|
||||
) : null}
|
||||
{!editingEvent?.wiederholung_parent_id && <FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
checked={Boolean(form.wiederholung)}
|
||||
@@ -957,8 +961,8 @@ function EventFormDialog({
|
||||
/>
|
||||
}
|
||||
label="Wiederholung"
|
||||
/>
|
||||
{form.wiederholung && (
|
||||
/>}
|
||||
{!editingEvent?.wiederholung_parent_id && form.wiederholung && (
|
||||
<Stack spacing={2} sx={{ pl: 2 }}>
|
||||
<FormControl fullWidth size="small">
|
||||
<InputLabel>Häufigkeit</InputLabel>
|
||||
|
||||
Reference in New Issue
Block a user