dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Previous month's date range selected when clicking on month button filter - check attached video

Open radh21301 opened this issue 1 year ago • 1 comments

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:

  1. Go to home screen
  2. Select a year from the drop down on the right side of the page
  3. 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

radh21301 avatar Jul 14 '24 03:07 radh21301

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

tetebueno avatar Jul 24 '24 02:07 tetebueno

I believe, this can happen if you are in a negative timezone (e.g. in the US).

Cyberax avatar Sep 16 '24 06:09 Cyberax

Fixed in https://github.com/Freika/dawarich/releases/tag/0.14.5, kudos to @gboudreau!

Freika avatar Sep 28 '24 15:09 Freika