Open goochj03 opened 1 year ago
Thanks for raising the issue @goochj03.
Several date handling specialities are in place that seem to trigger the difference in behaviour:
lastweek
does not satisfy the getLastDate detection due to not matching a regex. Changing the regex to /(last|previous)[0-9]+/
would restore the comparison values in your case, but I have not checked what could break with such a change.-1week
does satisfy the detection, but the JavaScript can not handle this format. This results in exceptions displaying "Error" for the period selector and breaking the graph.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
).
What happened?
Viewing the dashboard from the Widget example link for weekly periods, the comparison stats are not shown. Administration > Platform > Widgets
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
Last Week:
-1Week:
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