Fix that the timeline does not accept timestamps as start and end

refs #4190
This commit is contained in:
Johannes Meyer 2014-04-01 08:49:06 +02:00
parent c94cd40b92
commit 14ed3b6fe2
1 changed files with 4 additions and 2 deletions

View File

@ -210,14 +210,16 @@ class Monitoring_TimelineController extends ActionController
private function buildTimeRanges()
{
$startTime = new DateTime();
$startTimestamp = strtotime($this->_request->getParam('start'));
$startParam = $this->_request->getParam('start');
$startTimestamp = is_numeric($startParam) ? intval($startParam) : strtotime($startParam);
if ($startTimestamp !== false) {
$startTime->setTimestamp($startTimestamp);
}
$this->extrapolateDateTime($startTime);
$endTime = clone $startTime;
$endTimestamp = strtotime($this->_request->getParam('end'));
$endParam = $this->_request->getParam('end');
$endTimestamp = is_numeric($endParam) ? intval($endParam) : strtotime($endParam);
if ($endTimestamp !== false) {
$endTime->setTimestamp($endTimestamp);
} else {