diff --git a/client/src/components/FlightCreationForm/FlightCreationForm.tsx b/client/src/components/FlightCreationForm/FlightCreationForm.tsx index 0eccb62ad0259c2bf0adc138db9f31eec4151ab3..faf45435eb3202a84e4a2b1aa16a340c14dd0b4a 100644 --- a/client/src/components/FlightCreationForm/FlightCreationForm.tsx +++ b/client/src/components/FlightCreationForm/FlightCreationForm.tsx @@ -44,6 +44,11 @@ function FlightCreationForm() { return; } + if (new Date(formValue.departure).getTime() > new Date(formValue.arrival).getTime()) { + setError('Arrival time must be after departure time'); + return; + } + setError(''); setDisabled(true);