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
Owner

Fixes #237

Summary

  • Fix OCR receipt date parser (useMaintenanceReceiptOcr.ts) to use local time formatting instead of toISOString().split('T')[0] which converts to UTC and shifts dates by one day
  • Standard date parsing now uses getFullYear/getMonth/getDate (local time)
  • MM/DD/YYYY parsing formats directly from regex match groups without round-tripping through a Date object

Note: The backend setTypeParser(1082) fix, frontend edit dialog defensive parsing, and DatePicker onChange fixes were landed on main in prior commits (f0fc427, c05e33e, 8955baa). This PR completes the fix by addressing the last remaining toISOString() usage in the OCR date parser.

Test plan

  • Edit a maintenance record and verify the date in the edit dialog matches the list view exactly
  • Save a record without changing anything and confirm the date does not shift
  • Pick a new date via DatePicker and confirm it saves correctly
  • Upload a receipt via OCR and verify the extracted date is correct
  • Verify fuel logs (TIMESTAMP columns) are unaffected
Fixes #237 ## Summary - Fix OCR receipt date parser (`useMaintenanceReceiptOcr.ts`) to use local time formatting instead of `toISOString().split('T')[0]` which converts to UTC and shifts dates by one day - Standard date parsing now uses `getFullYear/getMonth/getDate` (local time) - MM/DD/YYYY parsing formats directly from regex match groups without round-tripping through a `Date` object Note: The backend `setTypeParser(1082)` fix, frontend edit dialog defensive parsing, and DatePicker onChange fixes were landed on main in prior commits (`f0fc427`, `c05e33e`, `8955baa`). This PR completes the fix by addressing the last remaining `toISOString()` usage in the OCR date parser. ## Test plan - [ ] Edit a maintenance record and verify the date in the edit dialog matches the list view exactly - [ ] Save a record without changing anything and confirm the date does not shift - [ ] Pick a new date via DatePicker and confirm it saves correctly - [ ] Upload a receipt via OCR and verify the extracted date is correct - [ ] Verify fuel logs (TIMESTAMP columns) are unaffected
egullickson added 1 commit 2026-03-24 01:58:09 +00:00
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
087f7b9fa5
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>
egullickson added 1 commit 2026-03-24 02:18:40 +00:00
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
1e056f0b01
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>
egullickson merged commit ac9c13c9d3 into main 2026-03-24 12:55:01 +00:00
egullickson deleted branch issue-237-fix-date-timezone 2026-03-24 12:55:01 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#238