fix: Maintenance dates display one day off due to timezone conversion (#237) #238

Merged
egullickson merged 2 commits from issue-237-fix-date-timezone into main 2026-03-24 12:55:01 +00:00

2 Commits

Author SHA1 Message Date
Eric Gullickson
1e056f0b01 fix: replace new Date() with dayjs for DATE column display and sorting (refs #237)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 1m19s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 44s
Deploy to Staging / Verify Staging (pull_request) Successful in 4s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 4s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
new Date("YYYY-MM-DD") parses as UTC midnight per ES2015. toLocaleDateString()
then displays in local time, shifting the date back one day for users west of
UTC. This caused the list view and edit dialog to show different dates.

Fixed in: MaintenanceRecordsList (display + sort + delete confirm),
VehicleDetailPage (display + sort), VehicleDetailMobile (display + sort),
MaintenanceRecordForm (receipt title), OwnershipCostsList (formatDate).

Sorting now uses string comparison (YYYY-MM-DD is lexicographically sortable).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:18:30 -05:00
Eric Gullickson
087f7b9fa5 fix: replace toISOString date conversion in OCR parser with local time formatting (refs #237)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 1m20s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 44s
Deploy to Staging / Verify Staging (pull_request) Successful in 4s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 4s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
The parseServiceDate function used toISOString().split('T')[0] which converts
to UTC, shifting dates by one day depending on timezone. Standard parsing now
uses getFullYear/getMonth/getDate (local time). MM/DD/YYYY parsing now formats
directly from regex groups without round-tripping through a Date object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:56:34 -05:00