Commit fc8e0f2d authored by tinogo's avatar tinogo

Fixed a bug with the datepicker when using it with date ranges

parent c7aa2023
......@@ -185,18 +185,18 @@ class Date
if ($this->request->getPost()->has($name[0]) && $this->request->getPost()->has($name[1])) {
$valueStart = $this->request->getPost()->get($name[0]);
$valueEnd = $this->request->getPost()->get($name[1]);
$valueStartR = $this->date->format($valueStart, 'r', false);
$valueEndR = $this->date->format($valueEnd, 'r', false);
$valueStartR = $this->date->format($valueStart, 'c', false);
$valueEndR = $this->date->format($valueEnd, 'c', false);
} elseif (is_array($value) && $this->dateValidationRule->isValid($value) === true) {
$valueStart = $this->date->format($value[0], $this->getDateFormat($showTime));
$valueEnd = $this->date->format($value[1], $this->getDateFormat($showTime));
$valueStartR = $this->date->format($value[0], 'r');
$valueEndR = $this->date->format($value[1], 'r');
$valueStartR = $this->date->format($value[0], 'c');
$valueEndR = $this->date->format($value[1], 'c');
} else {
$valueStart = $this->date->format('now', $this->getDateFormat($showTime), false);
$valueEnd = $this->date->format('now', $this->getDateFormat($showTime), false);
$valueStartR = $this->date->format('now', 'r', false);
$valueEndR = $this->date->format('now', 'r', false);
$valueStartR = $this->date->format('now', 'c', false);
$valueEndR = $this->date->format('now', 'c', false);
}
return [
......
......@@ -17,7 +17,7 @@ jQuery(document).ready(function ($) {
$datepickerEnd.data("DateTimePicker").minDate(e.date);
});
$datepickerEnd.data('DateTimePicker').minDate(new Date(datepickers.startDefaultDate));
$datepickerEnd.data('DateTimePicker').minDate(datepickers.startDefaultDate);
}
});
}
......@@ -26,4 +26,4 @@ jQuery(document).ready(function ($) {
$(this).datetimepicker();
});
}
});
\ No newline at end of file
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment