maybe icon indicating copy to clipboard operation
maybe copied to clipboard

Bug: Line chart is not updating end date

Open scubamaggo opened this issue 7 months ago • 0 comments

Describe the bug It appears that the line chart is not updating the end date when the application is running for longer periods. It is stuck on the date when the application was started.

To Reproduce Steps to reproduce the behavior:

  1. Go to an Account with a transaction history. The last date will be the current date.
  2. Wait until the next day.
  3. The end date is stuck on the date seen in step 1 and will not update unless the app is restarted(?).

Expected behavior The end date should be refreshed when the server date changes.

Additional context I suspect this is due to the way the Period class is initialized. The class contains this code:

    BUILTIN = [
        new(name: "all", date_range: nil..Date.current),
        new(name: "last_7_days", date_range: 7.days.ago.to_date..Date.current),
        new(name: "last_30_days", date_range: 30.days.ago.to_date..Date.current),
        new(name: "last_365_days", date_range: 365.days.ago.to_date..Date.current)
    ]

    INDEX = BUILTIN.index_by(&:name)

This is called once upon class initialization, and I suspect this class is never(?) instantiated again via the provided chart methods.

scubamaggo avatar Jul 02 '24 22:07 scubamaggo