diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-01-28 02:09:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 02:09:46 +0300 |
commit | 43c920cb44eb606bc8c16d2344ecec762a20ca21 (patch) | |
tree | dce12c50e4f9d0b9c4774d56a0110a54ed35703f /core | |
parent | ca9a0a523e75d3d10acfc0a0114d3d71287cd9ef (diff) |
Fix timezone issue when using magic date keywords (#17144)
* Fix timezone issue when using magic date keywords
* improve readability
* use Date::factoryInTimezone
Diffstat (limited to 'core')
-rw-r--r-- | core/Period/Factory.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/Period/Factory.php b/core/Period/Factory.php index b316bebefa..7c804df611 100644 --- a/core/Period/Factory.php +++ b/core/Period/Factory.php @@ -168,10 +168,9 @@ abstract class Factory } else { if (!($date instanceof Date)) { if (preg_match('/^(now|today|yesterday|yesterdaySameTime|last[ -]?(?:week|month|year))$/i', $date)) { - $date = Date::factory($date, $timezone); - } else { - $date = Date::factory($date); + $date = Date::factoryInTimezone($date, $timezone); } + $date = Date::factory($date); } $oPeriod = Factory::build($period, $date); } |