diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-10-03 08:32:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 08:32:46 +0300 |
commit | ae872e501015ec5ed5a538c23f6e090ce3089c66 (patch) | |
tree | 3571ac9215a05f02ca09a3a077805f4efe98b7ad /plugins/CoreVisualizations/Visualizations | |
parent | c50e5c2b8f20bfcb4df49780568a8fb7f9610d0b (diff) |
Create periods with timezones in a couple places that are missing it. (#13445)
* Create periods with timezones in a couple places that are missing it.
* tweak
* Apply timezone only if endDate is not a normal date.
* add comment
Diffstat (limited to 'plugins/CoreVisualizations/Visualizations')
-rw-r--r-- | plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php index f534119de0..43818d6a00 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php @@ -77,6 +77,8 @@ class Evolution extends JqplotGraph private function calculateEvolutionDateRange() { $period = Common::getRequestVar('period'); + $idSite = Common::getRequestVar('idSite'); + $timezone = Site::getTimezoneFor($idSite); $defaultLastN = self::getDefaultLastN($period); $originalDate = Common::getRequestVar('date', 'last' . $defaultLastN, 'string'); @@ -89,11 +91,10 @@ class Evolution extends JqplotGraph // if a multiple period // overwrite last_n param using the date range - $oPeriod = new Range($period, $originalDate); + $oPeriod = new Range($period, $originalDate, $timezone); $lastN = count($oPeriod->getSubperiods()); } else { - // if not a multiple period list($newDate, $lastN) = self::getDateRangeAndLastN($period, $originalDate, $defaultLastN); $this->requestConfig->request_parameters_to_modify['date'] = $newDate; |