Browse Source

Fix PHP warnings see #7826

Julio Montoya 9 years ago
parent
commit
e8847d6de0
1 changed files with 13 additions and 9 deletions
  1. 13 9
      main/inc/lib/formvalidator/Element/DateRangePicker.php

+ 13 - 9
main/inc/lib/formvalidator/Element/DateRangePicker.php

@@ -62,30 +62,34 @@ class DateRangePicker extends HTML_QuickForm_text
         }
 
         $minDate = null;
-        if (!empty($this->getAttribute('minDate'))) {
+        $minDateValue = $this->getAttribute('minDate');
+        if (!empty($minDateValue)) {
             $minDate = "
-                minDate: '{$this->getAttribute('minDate')}',
+                minDate: '{$minDateValue}',
             ";
         }
 
         $maxDate = null;
-        if (!empty($this->getAttribute('maxDate'))) {
+        $maxDateValue = $this->getAttribute('maxDate');
+        if (!empty($maxDateValue)) {
             $maxDate = "
-                maxDate: '{$this->getAttribute('maxDate')}',
+                maxDate: '{$maxDateValue}',
             ";
         }
 
         $format = 'YYYY-MM-DD HH:mm';
-        if (!empty($this->getAttribute('format'))) {
-            $format = $this->getAttribute('format');
+        $formatValue = $this->getAttribute('format');
+        if (!empty($formatValue)) {
+            $format = $formatValue;
         }
 
         $timePicker = 'true';
-        if (!empty($this->getAttribute('timePicker'))) {
-            $timePicker = $this->getAttribute('timePicker');
+        $timePickerValue =  $this->getAttribute('timePicker');
+        if (!empty($timePickerValue)) {
+            $timePicker = $timePickerValue;
         }
 
-        //timeFormat: 'hh:mm'
+        // timeFormat: 'hh:mm'
         $js .= "<script>
             $(function() {
                 $('#$id').daterangepicker({