Skip to content

Commit

Permalink
Address changes to Carbon::diffIn* methods
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jun 8, 2024
1 parent 84c28ee commit 990c591
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Classes/WorkingSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ protected function isTimeslotValid(DateTimeInterface $timeslot, DateTimeInterfac
return false;
}

if (Carbon::now()->diffInMinutes($timeslot) < $leadTimeMinutes) {
if (floor(Carbon::now()->diffInMinutes($timeslot)) < $leadTimeMinutes) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Models/WorkingHour.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function isOpenAllDay()
return null;
}

$diffInHours = $this->open->diffInHours($this->close);
$diffInHours = (int)floor($this->open->diffInHours($this->close));

return $diffInHours >= 23 || $diffInHours == 0;
}
Expand Down

0 comments on commit 990c591

Please sign in to comment.