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

Wrong dates returned when part of the date parameter is 'today' #6194

Closed
MichielDeMey opened this issue Sep 11, 2014 · 1 comment
Closed
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@MichielDeMey
Copy link
Contributor

Hi

I've noticed that when you use 'today' as the last parameter in the 'date' url parameter that it responds with one extra date in the array (the day before the start date).

Example:
http://demo.piwik.org/?module=API&method=VisitsSummary.getVisits&idSite=3&period=day&date=2014-09-01,today&format=json

Returns

{
"2014-08-31": 18,
"2014-09-01": 23,
"2014-09-02": 17,
"2014-09-03": 28,
"2014-09-04": 19,
"2014-09-05": 29,
"2014-09-06": 17,
"2014-09-07": 19,
"2014-09-08": 23,
"2014-09-09": 17,
"2014-09-10": 20,
"2014-09-11": 12
}

I requested the dates starting from 2014-09-01, but it included the previous day as well.

But when I manually enter the end date, it seems to return the dates just fine.

Example:
http://demo.piwik.org/?module=API&method=VisitsSummary.getVisits&idSite=3&period=day&date=2014-09-01,2014-09-11&format=json

Returns

{
"2014-09-01": 23,
"2014-09-02": 17,
"2014-09-03": 28,
"2014-09-04": 19,
"2014-09-05": 29,
"2014-09-06": 17,
"2014-09-07": 19,
"2014-09-08": 23,
"2014-09-09": 17,
"2014-09-10": 20,
"2014-09-11": 12
}

I found this bug on our servers running Piwik 2.6.1, as well as on the demo Piwik running 2.6.1 (see example URLs) and it's reproducible on every API call.

If you need more information, feel free to ask.

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 14, 2014
@mattab mattab added this to the Short term milestone Sep 14, 2014
@mattab
Copy link
Member

mattab commented Sep 14, 2014

Thanks for the report!

@tsteur tsteur self-assigned this Feb 4, 2015
@tsteur tsteur modified the milestones: Piwik 2.11.0, Short term Feb 4, 2015
mattab added a commit that referenced this issue Feb 9, 2015
@mattab mattab closed this as completed Feb 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants