Improve the time checking. #392

This commit is contained in:
Korina Cordero 2020-04-30 07:26:12 +00:00
parent da16bf54a3
commit 6effa53997

View file

@ -2700,15 +2700,15 @@ class APIController extends Controller implements LoggedController
// TODO: remove the time check after ECQ. This will then always return true
// get current time
$current_datetime = new DateTime();
$current_datetime = new DateTime();
//$current_datetime = DateTime::createFromFormat('Y-m-d H:i', '2020-04-30 13:34');
// get the hour
$current_time = $current_datetime->format('g:i A');
$hour = $current_datetime->format('G');
$time_array = explode(':', $current_time);
$hour = $time_array[0];
error_log($hour);
if (($hour < 8) && ($hour > 5))
if (($hour < 8) || ($hour > 17))
$schedule_choice = false;
$data = [