-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add case to shift_back function to handle day periods #2628
Conversation
BundleMonUnchanged files (7)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
Since the |
Yes I think you're on the right track :) We'd need the automated test cases in order to verify this change properly. |
Hey 👋! First of all, thank you for your contribution, David! We're building a comparisons feature that uses the shift_back functions extensively. In the context of this work we've refactored this function completely using a new strategy. The shift_back function itself does not exist anymore and it is equivalent to this clause of the analytics/lib/plausible/stats/comparisons.ex Lines 67 to 78 in 9a4c4f4
The code itself is simpler because instead of having a case for each requested period, we limit the end date to the current day. The bug your pull request is trying to solve is still there after the refactor, and I'm not sure this pull request actually fixes it. The shift back function was in fact shifting back 1 day for day periods, which is not entirely correct, as this does not take the time into account. If you're still interested in tackling this issue, I'd be happy to give you more context and to help as needed. I'd suggest you to start over, as this function has been entirely refactored, and working on the time precison from a clean slate. |
Hi @vinibrsl! It has been a while since I've worked on this issue plus there wasn't much code that was included in this PR, so I agree that it would be best to start over. I'm still interested in working on #1650, so I'll take a look through |
Hi @vinibrsl, I haven't found the time to work on updating this PR. |
Changes
Fixes #1650
This PR adds a case to the
shift_back
function inlib/plausible/stats/query.ex
to handle day periods.Tests
Changelog
Documentation
Dark mode