Use PHP's DateTime instead of our DateTimeFactory in the TimeLineController

I'm about to drop the DateTimeFactory because date_default_timezone_set() in combination w/ PHP's DateTime is sufficient.

refs #6778
This commit is contained in:
Eric Lippmann 2015-05-19 11:17:00 +02:00
parent 5cf8e2504e
commit b5a0f7950e
1 changed files with 1 additions and 4 deletions

View File

@ -1,11 +1,8 @@
<?php <?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
use \DateTime;
use \DateInterval;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Util\Format; use Icinga\Util\Format;
use Icinga\Util\DateTimeFactory;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Timeline\TimeLine; use Icinga\Module\Monitoring\Timeline\TimeLine;
use Icinga\Module\Monitoring\Timeline\TimeRange; use Icinga\Module\Monitoring\Timeline\TimeRange;
@ -233,7 +230,7 @@ class Monitoring_TimelineController extends Controller
*/ */
private function buildTimeRanges() private function buildTimeRanges()
{ {
$startTime = DateTimeFactory::create(); $startTime = new DateTime();
$startParam = $this->_request->getParam('start'); $startParam = $this->_request->getParam('start');
$startTimestamp = is_numeric($startParam) ? intval($startParam) : strtotime($startParam); $startTimestamp = is_numeric($startParam) ? intval($startParam) : strtotime($startParam);
if ($startTimestamp !== false) { if ($startTimestamp !== false) {