From 990c591689a22f58728e55c67130397640c2ba84 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sat, 8 Jun 2024 21:04:26 +0100 Subject: [PATCH] Address changes to Carbon::diffIn* methods Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Classes/WorkingSchedule.php | 2 +- src/Models/WorkingHour.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Classes/WorkingSchedule.php b/src/Classes/WorkingSchedule.php index e0d8299..c2cdc94 100644 --- a/src/Classes/WorkingSchedule.php +++ b/src/Classes/WorkingSchedule.php @@ -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; } diff --git a/src/Models/WorkingHour.php b/src/Models/WorkingHour.php index 9e0b943..d9eee92 100644 --- a/src/Models/WorkingHour.php +++ b/src/Models/WorkingHour.php @@ -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; }