Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
Matomo currently only restricts provided dates in the past. A date currently can't be set to earlier than August 1991 - the date were the first website went live.
Future dates are currently not restricted, even though it doesn't make sense to provide dates that are far in the future. As Matomo won't archive future dates, there can't be any data returned anyway.
Providing single periods like day, week, month or year far in the future is unproblematic, as Matomo would simply display no data for it.
Range periods and multiple period requests however are a bit different, as Matomo would try to process all subperiods that are included. As dates in the future can't have any data anyway, there is not much value in even trying to process those dates unlimited.
Therefor this PR introduces an internal limit for range periods. If a range is provided with an end date that is more than 10 years in the future, Matomo will automatically cut down the range to end at end of the current year + 10 years.
[ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
[ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
Description:
Matomo currently only restricts provided dates in the past. A date currently can't be set to earlier than August 1991 - the date were the first website went live.
Future dates are currently not restricted, even though it doesn't make sense to provide dates that are far in the future. As Matomo won't archive future dates, there can't be any data returned anyway.
Providing single periods like
day
,week
,month
oryear
far in the future is unproblematic, as Matomo would simply display no data for it.Range periods and multiple period requests however are a bit different, as Matomo would try to process all subperiods that are included. As dates in the future can't have any data anyway, there is not much value in even trying to process those dates unlimited. Therefor this PR introduces an internal limit for range periods. If a range is provided with an end date that is more than 10 years in the future, Matomo will automatically cut down the range to end at end of the current year + 10 years.
Review