Skip to content

Bug: shared date range picker can break pages using preset or calendar selection #8

@niyazmft

Description

@niyazmft

Problem

The issue is broader than Spending Analysis alone.

The shared date range picker can deliver inconsistent date value types into page-level consumers, which then causes runtime failures when those values are serialized.

Observed user-facing impact:

  • preset selections such as Last 30 Days, Last 90 Days, This Month, Last Month, and This Year can break pages using the shared picker
  • manual calendar selection can trigger the same class of failure on at least some affected flows
  • the visible runtime symptom is a date serialization error during refresh logic

Root cause

This is a shared contract bug between the common picker and its consumers.

Historically, page-level handlers such as the one in SpendingAnalysisView.vue assumed they would receive Date objects and immediately passed them into formatDateForInput().

At the same time, the shared picker had paths where emitted values were not consistently normalized to Date objects.

That mismatch produced failures like:

TypeError: toISOString is not a function

Affected surfaces

Confirmed direct consumers of the shared picker include:

  • frontend/src/views/SpendingAnalysisView.vue
  • frontend/src/views/TransactionsView.vue
  • frontend/src/components/Dashboard/HistoryPanel.vue

Because the contract is shared, this should be treated as a cross-page bug rather than a Spending Analysis-only issue.

Fix now present on main

The shared fix is present on main in commit ae3c0e0:

  • DateRangePicker.vue now consistently stores and emits Date objects for picker flows
  • utils.formatDateForInput() now safely accepts both Date and string values
  • regression coverage was added for preset paths in frontend/tests/components/DateRangePicker.spec.js

Remaining validation needed

To fully close this class of bug with confidence, browser validation should confirm that the following all work without runtime errors:

  • Last 30 Days
  • Last 90 Days
  • This Month
  • Last Month
  • This Year
  • manual calendar-based date selection

across all pages using the shared picker.

Acceptance criteria

  • no toISOString runtime errors from shared date range selection
  • preset selection works on all shared-picker consumers
  • manual calendar selection works on all shared-picker consumers
  • test coverage exists for the shared contract and at least one page-level integration flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions