Skip to content
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

Support date format last week, last month, last year #13818

Closed
fdellwing opened this issue Dec 10, 2018 · 7 comments · Fixed by #16830
Closed

Support date format last week, last month, last year #13818

fdellwing opened this issue Dec 10, 2018 · 7 comments · Fixed by #16830
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@fdellwing
Copy link
Contributor

fdellwing commented Dec 10, 2018

https://demo.matomo.org/index.php?module=MultiSites&action=index&idSite=3&period=day&date=last%20week

If you open this link, the datepicker is not present at all, but last week is working as intended.

On dashboard the datepicker is present.

@tsteur
Copy link
Member

tsteur commented Dec 10, 2018

@fdellwing it's not a supported date format and while it works currently, it is not guaranteed it will work in the future.

@tsteur tsteur closed this as completed Dec 10, 2018
@tsteur tsteur added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Dec 10, 2018
@fdellwing
Copy link
Contributor Author

fdellwing commented Dec 10, 2018

It is supported by strtotime() and that will not change, you even tell the people to look up the php.net article.

Also it should be easy to fix, because you already have a date object, you just need to throw it into the datepicker.

@tsteur
Copy link
Member

tsteur commented Dec 10, 2018

We still support only couple formats as there are places where we need to detect what kind of date format it is. It's not that easy to support it. I can't even guarantee the data it is showing is correct. Also when you say last week the period would need to be range as multiple dates are not supported by the UI with a non-range period.

@fdellwing
Copy link
Contributor Author

You are aware, of the fact, that "last week" is not a week (strtotime will always return a timestamp and not a range), but the day exactly one week ago?

https://demo.matomo.org/index.php?module=MultiSites&action=index&idSite=3&period=day&date=last%20week
https://demo.matomo.org/index.php?module=MultiSites&action=index&idSite=3&period=day&date=2018-12-03

@tsteur
Copy link
Member

tsteur commented Dec 10, 2018

Didn't know. It doesn't change too much though sorry. I can leave the issue open if you want and change the title to support this date format in the future.

@tsteur tsteur reopened this Dec 10, 2018
@tsteur tsteur changed the title Datepicker missing on all websites if called with "unsupported" option Support date format "last week" Dec 10, 2018
@tsteur tsteur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. and removed wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. labels Dec 10, 2018
@mattab mattab changed the title Support date format "last week" Support date format last week, last month, last year Mar 12, 2019
@mattab mattab added this to the 3.11.0 milestone Mar 12, 2019
@mattab
Copy link
Member

mattab commented Mar 12, 2019

Thanks for creating this issue. We also got a customer report just today about this. And I'm wishing we have this feature once a month for a few months already :-)

Use case: when doing manual reporting using Matomo numbers, the reporting process can include several links to Matomo reports for "Last month" (documented in a wiki page or spreadsheet.) Currently it is not possible with Matomo to put a static link that will always load last month's data. One can only put a link to a previous month's data and then has to click on it, and manually change date in calendar.

in Matomo when you open a direct link to a report with date=last%20month you get error: Date::factoryInTimezone() should not be used with last month.. If using date=lastmonth can also get the error: Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information): .

in comparison this works well in Woocommerce reports which makes it much easier to report numbers in just a click: https://woocommerce/wp-admin/admin.php?page=wc-reports&tab=customers&range=last_month

in my case for example I have more than 10 Matomo links that i'd like to open the "last month" data automatically. Would save valuable time and remove steps (having to change the date each time is tricky) when date=lastmonth and/or last month is supported. (be good to add this supported value in the API reference page also: http://developer.piwik.org/api-reference/reporting-api )

@tsteur tsteur modified the milestones: 3.13.0, 4.1.0 Jul 31, 2019
@sgiehl sgiehl self-assigned this Nov 27, 2020
@mattab mattab added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Dec 11, 2020
@laratutoteam

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants