Browse Source

Minor - move condition

Julio Montoya 6 years ago
parent
commit
74402c917a
1 changed files with 5 additions and 5 deletions
  1. 5 5
      main/cron/import_csv.php

+ 5 - 5
main/cron/import_csv.php

@@ -1085,6 +1085,11 @@ class ImportCsv
                 $startDate = $startDateYear.'-'.$startDateMonth.'-'.$startDateDay.' '.$startTime.':00';
                 $endDate = $startDateYear.'-'.$startDateMonth.'-'.$startDateDay.' '.$endTime.':00';
 
+                if (!api_is_valid_date($startDate) || !api_is_valid_date($endDate)) {
+                    $this->logger->addInfo("Verify your dates:  '$startDate' : '$endDate' ");
+                    $errorFound = true;
+                }
+
                 // Check session dates
                 if ($sessionInfo && !empty($sessionInfo['access_start_date'])) {
                     $date = new \DateTime($sessionInfo['access_start_date']);
@@ -1100,11 +1105,6 @@ class ImportCsv
                     }
                 }
 
-                if (!api_is_valid_date($startDate) || !api_is_valid_date($endDate)) {
-                    $this->logger->addInfo("Verify your dates:  '$startDate' : '$endDate' ");
-                    $errorFound = true;
-                }
-
                 if ($errorFound == false) {
                     $eventsToCreate[] = [
                         'start' => $startDate,