From 6effa5399748dd9a7f2cbcbd6b5325c132e68cfd Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Thu, 30 Apr 2020 07:26:12 +0000 Subject: [PATCH] Improve the time checking. #392 --- src/Controller/APIController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index 7c99f912..b783477e 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -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 = [