Corrected unavailable dates calculation for current day.

This commit is contained in:
Alex Tselegidis 2016-07-19 09:48:55 +02:00
parent cb425e4221
commit a47d03e616

View file

@ -506,7 +506,7 @@ class Appointments extends CI_Controller {
for ($i=1; $i<=$number_of_days; $i++) { for ($i=1; $i<=$number_of_days; $i++) {
$current_date = new DateTime($selected_date->format('Y-m') . '-' . $i); $current_date = new DateTime($selected_date->format('Y-m') . '-' . $i);
if ($current_date < new DateTime()) { // Past dates become immediatelly unavailable. if ($current_date < new DateTime(date('Y-m-d 00:00:00'))) { // Past dates become immediatelly unavailable.
$unavailable_dates[] = $current_date->format('Y-m-d'); $unavailable_dates[] = $current_date->format('Y-m-d');
continue; continue;
} }