Resolve availability generation issue with 5 minute services.

This commit is contained in:
Alex Tselegidis 2021-07-19 16:59:41 +03:00
parent 9ddc820176
commit 5d513ea43f

View file

@ -307,7 +307,7 @@ class Availability {
$current_hour = $start_hour; $current_hour = $start_hour;
$diff = $current_hour->diff($end_hour); $diff = $current_hour->diff($end_hour);
while (($diff->h * 60 + $diff->i) >= (int)$service['duration']) while (($diff->h * 60 + $diff->i) >= (int)$service['duration'] && $diff->invert === 0)
{ {
$available_hours[] = $current_hour->format('H:i'); $available_hours[] = $current_hour->format('H:i');
$current_hour->add(new DateInterval('PT' . $interval . 'M')); $current_hour->add(new DateInterval('PT' . $interval . 'M'));