Cleanup custom field handling... twice
[civicrm-core.git] / CRM / Utils / Date.php
index 4031a11ad71d9b3ffa1f1a3661cf4f0f23a03b0b..9e4eac33ed88f7b4dde7c60a5e5a41c39c87f2df 100644 (file)
@@ -771,7 +771,7 @@ class CRM_Utils_Date {
       $now = self::isoToMysql($now);
     }
 
-    return (strtotime($mysqlDate) >= strtotime($now)) ? FALSE : TRUE;
+    return !(strtotime($mysqlDate) >= strtotime($now));
   }
 
   /**
@@ -950,12 +950,12 @@ class CRM_Utils_Date {
    */
   public static function intervalAdd($unit, $interval, $date, $dontCareTime = FALSE) {
     if (is_array($date)) {
-      $hour = CRM_Utils_Array::value('H', $date);
-      $minute = CRM_Utils_Array::value('i', $date);
-      $second = CRM_Utils_Array::value('s', $date);
-      $month = CRM_Utils_Array::value('M', $date);
-      $day = CRM_Utils_Array::value('d', $date);
-      $year = CRM_Utils_Array::value('Y', $date);
+      $hour = $date['H'] ?? NULL;
+      $minute = $date['i'] ?? NULL;
+      $second = $date['s'] ?? NULL;
+      $month = $date['M'] ?? NULL;
+      $day = $date['d'] ?? NULL;
+      $year = $date['Y'] ?? NULL;
     }
     else {
       extract(date_parse($date));