Skip to content

fix: route simulateDate through getTodayInTZ (single date source of truth) #175

Description

@krwg

Summary

Dev date simulation and real calendar day helpers diverge. Make getTodayInTZ() the single source of truth so every habit/calendar/notification path respects Dev Mode date override automatically.

Problem

  • dev-mode.js exposes simulateDate(dateString) and keeps override state separately.
  • timezone.js getTodayInTZ() does not honor that override.
  • New date-aware modules tend to call getTodayInTZ() and silently ignore simulation → unreliable Dev Mode bug reports.

Approach

In core/timezone.js:

  • Private _devDateOverride (YYYY-MM-DD | null)
  • __setDevDateOverride / __clearDevDateOverride
  • getTodayInTZ() returns override when set

dev-mode.js simulateDate calls those helpers instead of a parallel path.

Acceptance

  • Habits, analytics, calendar, native notifications all follow simulated day via getTodayInTZ
  • Clearing override restores real TZ day
  • No duplicate “today” helpers for production paths

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions