Fix chart timezone bug #2224

Merged
zachgoll merged 1 commits from zachgoll/fix-chart-timezone-bug into main 2025-05-08 10:19:09 +08:00
zachgoll commented 2025-05-08 10:06:23 +08:00 (Migrated from github.com)

The Period value object (used for many charts) was instantiating pre-defined date ranges into a config hash and reading them at request time.

Since our timezones are dynamically set around each request and these values were already instantiated, the Date.current used in many of them was evaluating based on UTC time instead of the user's configured timezone.

This PR configures these pre-defined values as procs so they are evaluated dynamically within the context of the user's timezone.

The `Period` value object (used for many charts) was instantiating pre-defined date ranges into a config hash and reading them at request time. Since our timezones are dynamically set around each request and these values were already instantiated, the `Date.current` used in many of them was evaluating based on UTC time instead of the user's configured timezone. This PR configures these pre-defined values as procs so they are evaluated dynamically within the context of the user's timezone.
Sign in to join this conversation.