From 5cf8e2504e6f5cd00116c0df55b578cd9185b6a0 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 19 May 2015 11:14:41 +0200 Subject: [PATCH] lib/grid: Use PHP's DateTime instead of our DateTimeFactory I'm about to drop the DateTimeFactory because date_default_timezone_set() in combination w/ PHP's DateTime is sufficient. refs #6778 --- library/Icinga/Web/Widget/Chart/HistoryColorGrid.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php index d1c9a677f..efaa02a5b 100644 --- a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php +++ b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php @@ -3,10 +3,10 @@ namespace Icinga\Web\Widget\Chart; -use Icinga\Util\DateTimeFactory; +use DateInterval; +use DateTime; use Icinga\Util\Color; use Icinga\Web\Widget\AbstractWidget; -use DateInterval; /** * Display a colored grid that visualizes a set of values for each day @@ -312,7 +312,7 @@ class HistoryColorGrid extends AbstractWidget { private function monthName($month, $year) { // TODO: find a way to render years without messing up the layout - $dt = DateTimeFactory::create($year . '-' . $month . '-01'); + $dt = new DateTime($year . '-' . $month . '-01'); return $dt->format('M'); } @@ -323,7 +323,7 @@ class HistoryColorGrid extends AbstractWidget { */ private function weekdayName($weekday) { - $sun = DateTimeFactory::create('last Sunday'); + $sun = new DateTime('last Sunday'); $interval = new DateInterval('P' . $weekday . 'D'); $sun->add($interval); return substr($sun->format('D'), 0, 2);