Skip to content

Commit

Permalink
🐛 fix manual trip creation for stopover with different times (#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Mar 11, 2024
1 parent 334ecdd commit de6468b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Backend/Transport/ManualTripCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public function addStopover(
if ($plannedDeparture === null && $plannedArrival === null) {
throw new InvalidArgumentException('Either arrival or departure must be set');
}
if ($plannedDeparture !== null && $plannedArrival !== null && $plannedDeparture->isAfter($plannedArrival)) {
throw new InvalidArgumentException('Departure must be before arrival');
if ($plannedDeparture !== null && $plannedArrival !== null && $plannedDeparture->isBefore($plannedArrival)) {
throw new InvalidArgumentException('Departure must be after arrival');
}

$this->stopovers[] = [
Expand Down

0 comments on commit de6468b

Please sign in to comment.