Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2021-01-28 02:09:46 +0300
committerGitHub <noreply@github.com>2021-01-28 02:09:46 +0300
commit43c920cb44eb606bc8c16d2344ecec762a20ca21 (patch)
treedce12c50e4f9d0b9c4774d56a0110a54ed35703f /core
parentca9a0a523e75d3d10acfc0a0114d3d71287cd9ef (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.php5
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);
}