From 4d154fb25280f7d37f528c8d77567f95e6612f22 Mon Sep 17 00:00:00 2001 From: Jan Linhart Date: Mon, 11 Jul 2016 18:50:45 +0200 Subject: [PATCH] Set the user timezone before comparing data --- app/bundles/CoreBundle/Helper/Chart/ChartQuery.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/bundles/CoreBundle/Helper/Chart/ChartQuery.php b/app/bundles/CoreBundle/Helper/Chart/ChartQuery.php index 7643771038e..611ea1964e3 100644 --- a/app/bundles/CoreBundle/Helper/Chart/ChartQuery.php +++ b/app/bundles/CoreBundle/Helper/Chart/ChartQuery.php @@ -123,7 +123,6 @@ public function applyDateFilters(&$query, $dateColumn, $tablePrefix = 't') // Check if the date filters have already been applied if ($parameters = $query->getParameters()) { if (array_key_exists('dateTo', $parameters) || array_key_exists('dateFrom', $parameters)) { - return; } } @@ -156,7 +155,6 @@ public function applyDateFilters(&$query, $dateColumn, $tablePrefix = 't') $query->setParameter('dateTo', $dateTo->format('Y-m-d H:i:s')); } } - } } @@ -306,6 +304,7 @@ public function completeTimeData($rawData, $countAverage = false) // Data from the database will always in UTC $itemDate = new \DateTime($item['date'], $utcTz); + $itemDate->setTimezone($previousDate->getTimezone()); if (!in_array($this->unit, array('H', 'i', 's'))) { // Hours do not matter so let's reset to 00:00:00 for date comparison