diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-07-01 06:28:51 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-07-01 06:28:51 +0400 |
commit | de6104d4491275b2abafd266c5616462286be1e7 (patch) | |
tree | 7cfabf3f47c9f2109b04c612f317815d5300bb38 /core/Period | |
parent | be4b20327950e4b7f0114666669863ab51af1847 (diff) |
Fixes #5356 Applying change suggested in pull request https://github.com/piwik/piwik/pull/320
(the only change was to set default timezone to UTC)
Diffstat (limited to 'core/Period')
-rw-r--r-- | core/Period/Factory.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/Period/Factory.php b/core/Period/Factory.php index 996e2e792a..11d5203ab7 100644 --- a/core/Period/Factory.php +++ b/core/Period/Factory.php @@ -23,16 +23,18 @@ class Factory * * @param string $period `"day"`, `"week"`, `"month"`, `"year"`, `"range"`. * @param Date|string $date A date within the period or the range of dates. + * @param Date|string $timezone Optional timezone that will be used only when $period is 'range' or $date is 'last|previous' * @throws Exception If `$strPeriod` is invalid. * @return \Piwik\Period */ - static public function build($period, $date) + static public function build($period, $date, $timezone = 'UTC') { self::checkPeriodIsEnabled($period); if (is_string($date)) { - if (Period::isMultiplePeriod($date, $period) || $period == 'range') { - return new Range($period, $date); + if (Period::isMultiplePeriod($date, $period) + || $period == 'range') { + return new Range($period, $date, $timezone); } $date = Date::factory($date); } |