calendar download, date input validate, nc talk notification
This commit is contained in:
@@ -1807,6 +1807,20 @@ export default function Kalender() {
|
||||
}, [bookingForm.fahrzeugId, bookingForm.beginn, bookingForm.ende]);
|
||||
|
||||
const handleBookingSave = async () => {
|
||||
if (!isValidGermanDateTime(bookingForm.beginn)) {
|
||||
setBookingDialogError('Ungültiges Beginn-Datum (Format: TT.MM.JJJJ HH:MM)');
|
||||
return;
|
||||
}
|
||||
if (!isValidGermanDateTime(bookingForm.ende)) {
|
||||
setBookingDialogError('Ungültiges Ende-Datum (Format: TT.MM.JJJJ HH:MM)');
|
||||
return;
|
||||
}
|
||||
const beginnIso = fromGermanDateTime(bookingForm.beginn)!;
|
||||
const endeIso = fromGermanDateTime(bookingForm.ende)!;
|
||||
if (new Date(endeIso) <= new Date(beginnIso)) {
|
||||
setBookingDialogError('Ende muss nach dem Beginn liegen');
|
||||
return;
|
||||
}
|
||||
setBookingDialogLoading(true);
|
||||
setBookingDialogError(null);
|
||||
try {
|
||||
@@ -2216,7 +2230,9 @@ export default function Kalender() {
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<FileDownloadIcon />}
|
||||
onClick={() => window.open(icalEventUrl, '_blank')}
|
||||
component="a"
|
||||
href={icalEventUrl}
|
||||
download="veranstaltungen.ics"
|
||||
>
|
||||
Herunterladen
|
||||
</Button>
|
||||
@@ -2711,7 +2727,9 @@ export default function Kalender() {
|
||||
<Button
|
||||
variant="outlined"
|
||||
startIcon={<FileDownloadIcon />}
|
||||
onClick={() => window.open(icalBookingUrl, '_blank')}
|
||||
component="a"
|
||||
href={icalBookingUrl}
|
||||
download="buchungen.ics"
|
||||
>
|
||||
Herunterladen
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user