new features
This commit is contained in:
@@ -287,10 +287,17 @@ function FahrzeugBuchungen() {
|
||||
setDialogLoading(true);
|
||||
setDialogError(null);
|
||||
try {
|
||||
const beginnDate = new Date(form.beginn);
|
||||
const endeDate = new Date(form.ende);
|
||||
if (isNaN(beginnDate.getTime()) || isNaN(endeDate.getTime())) {
|
||||
setDialogError('Ungültiges Datum. Bitte Beginn und Ende prüfen.');
|
||||
setDialogLoading(false);
|
||||
return;
|
||||
}
|
||||
const payload: CreateBuchungInput = {
|
||||
...form,
|
||||
beginn: new Date(form.beginn).toISOString(),
|
||||
ende: new Date(form.ende).toISOString(),
|
||||
beginn: beginnDate.toISOString(),
|
||||
ende: endeDate.toISOString(),
|
||||
ganztaegig: form.ganztaegig || false,
|
||||
};
|
||||
if (editingBooking) {
|
||||
@@ -374,6 +381,7 @@ function FahrzeugBuchungen() {
|
||||
buchungsArt: detailBooking.buchungs_art,
|
||||
kontaktPerson: '',
|
||||
kontaktTelefon: '',
|
||||
ganztaegig: detailBooking.ganztaegig || false,
|
||||
});
|
||||
setDialogError(null);
|
||||
setAvailability(null);
|
||||
@@ -698,9 +706,10 @@ function FahrzeugBuchungen() {
|
||||
}}
|
||||
/>
|
||||
<Typography variant="body2">
|
||||
{format(parseISO(detailBooking.beginn), 'dd.MM.yyyy HH:mm')}
|
||||
{' – '}
|
||||
{format(parseISO(detailBooking.ende), 'dd.MM.yyyy HH:mm')}
|
||||
{detailBooking.ganztaegig
|
||||
? `${format(parseISO(detailBooking.beginn), 'dd.MM.yyyy')} – ${format(parseISO(detailBooking.ende), 'dd.MM.yyyy')} (Ganztägig)`
|
||||
: `${format(parseISO(detailBooking.beginn), 'dd.MM.yyyy HH:mm')} – ${format(parseISO(detailBooking.ende), 'dd.MM.yyyy HH:mm')}`
|
||||
}
|
||||
</Typography>
|
||||
{detailBooking.gebucht_von_name && (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mt: 0.5 }}>
|
||||
@@ -778,7 +787,6 @@ function FahrzeugBuchungen() {
|
||||
{vehicles.map((v) => (
|
||||
<MenuItem key={v.id} value={v.id}>
|
||||
{v.bezeichnung}
|
||||
{v.amtliches_kennzeichen ? ` (${v.amtliches_kennzeichen})` : ''}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
|
||||
Reference in New Issue
Block a user