Previous month's date range selected when clicking on month button filter - check attached video
Describe the bug When I click on the month name, that on the right side of the page -> I expect it to filter out all the point that were logged in that month. But intact it loads all the points from the previous month. Please check the video attached.
Version 0.9.1
To Reproduce Steps to reproduce the behavior:
- Go to home screen
- Select a year from the drop down on the right side of the page
- Then click on a month, then observe the filters set on the "Start At" and "End at" boxes -> above the map element
Expected behavior The selected month filter needs to be applied correctly, and not the previous month
Screenshots
https://github.com/user-attachments/assets/0844ab7d-a965-4d93-ae33-67f1d4ffc0b2
Logs none
Additional context none
Same thing in stats page, after selecting a year.
No Ruby expert here, but is it OK to have both a parameter and a local variable with the same (month) here?
def timespan(month, year)
month = DateTime.new(year, month).in_time_zone(Time.zone)
start_at = month.beginning_of_month.to_time.strftime('%Y-%m-%dT%H:%M')
end_at = month.end_of_month.to_time.strftime('%Y-%m-%dT%H:%M')
{ start_at:, end_at: }
end
I believe, this can happen if you are in a negative timezone (e.g. in the US).
Fixed in https://github.com/Freika/dawarich/releases/tag/0.14.5, kudos to @gboudreau!