Skip to content

More timezone date-shift bugs; configured timezones are never applied #390

Description

@cavidelizade

Summary

More date-only fields are parsed as UTC and then compared against local now/today, so date filters and "overdue" logic shift by the timezone offset for users behind UTC. Same class as the Gantt fix (#358). The underlying cause is that the timezone settings the app stores are never applied.

Confirmed spots

  • apps/web/src/lib/moduleWorkItemsApply.ts: "Overdue" uses local midnight sod vs a UTC-parsed target_date, so an item due today is flagged overdue in the afternoon in UTC-5. "This week" mis-buckets on the week boundary the same way.
  • apps/web/src/pages/ViewDetailPage.tsx and WorkspaceViewsPage.tsx: the date-range presets do new Date(i.start_date) (UTC midnight) vs local now/addDays(now, ...). (Custom range is fine, both sides UTC.)
  • apps/web/src/pages/ModulesPage.tsx: new Date(iso.slice(0,10)) vs local today in inRange.

CyclesPage/DateRangeModal/ProjectsListPage do this correctly with parseISODateLocal, which is the intended helper; these files should use it too.

Root cause

The timezone fields on cycle/project/workspace/user are stored but never read (Timezone: "UTC" is hardcoded on cycles and nothing consults it). All per-day bucketing uses TO_CHAR(i.updated_at, 'YYYY-MM-DD') at the DB session timezone. So the whole class of shifts stems from date logic that ignores the configured timezone.

Suggested fix

Route these date-only comparisons through parseISODateLocal (or compare date substrings), and decide whether per-day bucketing should honor the user/project timezone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions