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:
authorThomas Steur <tsteur@users.noreply.github.com>2020-07-20 09:32:31 +0300
committerGitHub <noreply@github.com>2020-07-20 09:32:31 +0300
commitb04f6933ad746d2c6159b138dd2d9b6bc959947d (patch)
tree227a336c4aed6e929ee6ec9bb06ada1cb26d31d6 /core
parent38cf2ef0d9968fdef2d4111755096efa56befce5 (diff)
Fix start/end time for given period it can skip this archive (#16221)
Diffstat (limited to 'core')
-rw-r--r--core/DataAccess/RawLogDao.php5
-rw-r--r--core/Period.php11
2 files changed, 5 insertions, 11 deletions
diff --git a/core/DataAccess/RawLogDao.php b/core/DataAccess/RawLogDao.php
index 6aab8c7f94..d29d9eeb30 100644
--- a/core/DataAccess/RawLogDao.php
+++ b/core/DataAccess/RawLogDao.php
@@ -214,7 +214,8 @@ class RawLogDao
}
/**
- * Returns the list of the website IDs that received some visits between the specified timestamp.
+ * Returns the list of the website IDs that received some visits between the specified timestamp. The
+ * start date and the end date is included in the time frame.
*
* @param string $fromDateTime
* @param string $toDateTime
@@ -226,7 +227,7 @@ class RawLogDao
FROM " . Common::prefixTable('log_visit') . "
WHERE idsite = ?
AND visit_last_action_time >= ?
- AND visit_last_action_time < ?
+ AND visit_last_action_time <= ?
LIMIT 1", array($idSite, $fromDateTime, $toDateTime));
return (bool) $sites;
diff --git a/core/Period.php b/core/Period.php
index b5ad4f7841..4059a80155 100644
--- a/core/Period.php
+++ b/core/Period.php
@@ -281,15 +281,8 @@ abstract class Period
*/
public function getBoundsInTimezone(string $timezone)
{
- $date1 = $this->getDateStart();
- $date1 = Date::factory($date1)->getTimestamp();
- $date1 = Date::adjustForTimezone($date1, $timezone);
- $date1 = Date::factory($date1);
-
- $date2 = $this->getDateEnd();
- $date2 = Date::factory($date2)->addDay(1)->getStartOfDay();
- $date2 = Date::adjustForTimezone($date2->getTimestamp(), $timezone);
- $date2 = Date::factory($date2);
+ $date1 = $this->getDateTimeStart()->setTimezone($timezone);
+ $date2 = $this->getDateTimeEnd()->setTimezone($timezone);
return [$date1, $date2];
}