-
Notifications
You must be signed in to change notification settings - Fork 0
Bug: shared date range picker can break pages using preset or calendar selection #8
Description
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.vuefrontend/src/views/TransactionsView.vuefrontend/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.vuenow consistently stores and emitsDateobjects for picker flowsutils.formatDateForInput()now safely accepts bothDateand 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
toISOStringruntime 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