New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using last (week|month|year) as date param #16830
Conversation
Should these be usable in the API? If so, would it be good to have a system test or two for them? |
Tested locally, works well, tested comparison + export links. Left one other test related comment, otherwise lgtm |
Yes be great to document here if it's supported in the API https://developer.matomo.org/api-reference/reporting-api |
@diosmosis it actually wasn't possible to use those as api params. at least the results were incorrect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one more minor comment, otherwise LGTM
Description:
Using one those values actually won't directly pass them to strtotime, as it might have imho unexpected results.
last week
passed tostrtotime
for example always returns the monday of the previous week. Instead I guess it would be expected to result in the day 7 days ago. Similar applies to last month and year.For last month there are still some edge cases on the last day of a month when the previous month didn't have that much days.
E.g.
last month
on 31th Dezember would return 1st Dezemberfixes #13818
Review