Skip to content

fix(web): drive history period filters from recorded data - #81

Merged
eigger merged 2 commits into
masterfrom
fix/history-period-data-driven
Aug 7, 2026
Merged

fix(web): drive history period filters from recorded data#81
eigger merged 2 commits into
masterfrom
fix/history-period-data-driven

Conversation

@eigger

@eigger eigger commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace input type="month" (picker does not open in Safari/Firefox) with year + month <select> pair
  • Add GET /api/vehicles/:id/history-periods?scope=trips|fuel|maintenance returning only years/months that have records
  • Year filter now lists only years with data instead of a hardcoded 2000-2100 range

Test plan

  • History → Trips/Fuel/Maintenance: Month shows year and month dropdowns, both filter correctly
  • Only years/months that contain records appear per tab
  • Day picker still opens and filters
  • Clear period resets the filter
  • npm run build passes

Made with Cursor

eigger and others added 2 commits August 8, 2026 00:54
Replace the unreliable native month input with year/month selects and list only years and months that actually have trips, fuel logs, or maintenance records via a new history-periods endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
Selecting a year in month mode cleared the applied filter, which wiped the year dropdown back to its placeholder before a month could be picked. Also drop the AT TIME ZONE conversion: the date columns are timestamp without time zone holding UTC wall clock values, so converting them made the month buckets depend on the database session timezone.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eigger
eigger merged commit 927a02f into master Aug 7, 2026
4 checks passed
@eigger
eigger deleted the fix/history-period-data-driven branch August 7, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant