matomo-org / matomo

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!
https://matomo.org/
GNU General Public License v3.0
19.94k stars 2.66k forks source link

[Bug] Comparison stats removed on widgitized dashboard for 'week' period #21560

Open goochj03 opened 1 year ago

goochj03 commented 1 year ago

What happened?

Viewing the dashboard from the Widget example link for weekly periods, the comparison stats are not shown. Administration > Platform > Widgets image

For example:

/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite=1&period=week&date=lastweek

If using /index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite=1&period=week&date=-1week the comparions stats are shown but the calendar date shows an error.

What should happen?

The comparisons stats should be shown if the url is set to period=week&date=lastweek

How can this be reproduced?

Go to Administration > Platform > Widgets Click on the 'example' link and set the date period to period=week&date=lastweek image

Last Week: image

-1Week: image

Matomo major version

Matomo 4

Matomo minor or patch Version

Matomo 4

PHP version

8.1

Server operating system

N/A

What browsers are you seeing the problem on?

No response

Computer operating system

N/A

Relevant log output

No response

Validations

mneudert commented 1 year ago

Thanks for raising the issue @goochj03.

Several date handling specialities are in place that seem to trigger the difference in behaviour:

Might also need a look into how much of the strtotime keywords should be supported by both frontend and backend (e.g. 1 week ago as an alternative to last week).