-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Bug on ranges using "last" and "previous" #7057
Conversation
I don't think I've ever seen |
OK, here is the code part that's responsible for that I think: // last1 means only one result ; last2 means 2 results so we remove only 1 to the days/weeks/etc
$lastN--;
$lastN = abs($lastN); If |
So I guess the issue is previous0 is handled incorrectly? Or doesn't fail if its supposed to fail. Personally, I don't see any use to previous0 or last0. |
Because right now I've pushed a fix for |
Well, like I said, I've never seen previous being used by itself; that said I doubt it would hurt if it was handled to function like |
You are right it doesn't hurt if |
Bug on ranges using "last" and "previous"
@piwik/core-team-access-all-repositories I'm opening this PR to validate with you that this is a bug and not a feature:
The first one returns a period spanning on 2 weeks, whereas the second returns the expect period of one (the previous week).
I have committed failing test cases in the branch (have a look at the diff), I haven't jumped at fixing this because maybe it's intended that way and it shouldn't be broken? (but then why?)