Skip to content

Fix "Invalid date" on synced transactions#14

Merged
super3 merged 1 commit into
mainfrom
claude/fern-mvp-design-adv0ks
Jul 20, 2026
Merged

Fix "Invalid date" on synced transactions#14
super3 merged 1 commit into
mainfrom
claude/fern-mvp-design-adv0ks

Conversation

@super3

@super3 super3 commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Connecting a Sandbox bank worked, but every synced transaction rendered "Invalid Date" for its day label and date line.

Root cause

pg returns Postgres DATE columns as JS Date objects, so res.json serialized transaction dates as full ISO timestamps ("2026-07-18T00:00:00.000Z") instead of the YYYY-MM-DD the API contract intends. The frontend then built "<iso-timestamp>T00:00:00" strings, which new Date(...) parses as Invalid Date.

Fix (both ends)

  • ServergetTransactionsForUser normalizes date and authorized_date to plain YYYY-MM-DD strings via a new toDateString helper (handles Date, string, and null; unit tests cover all three arms, 100% coverage maintained — 52 tests passing).
  • FrontendplaidMapping.ts slices incoming dates to YYYY-MM-DD before parsing/grouping, so the UI renders correctly against either API shape — no ordering dependency between the Pages deploy and the Railway redeploy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QeevtGJHrXu6XsJaAZNLWV


Generated by Claude Code

pg returns Postgres DATE columns as JS Date objects, so res.json
serialized transaction dates as full ISO timestamps
("2026-07-18T00:00:00.000Z"). The frontend then built
"<iso>T00:00:00" date strings, which parse as Invalid Date for every
day label and transaction sub-line.

- server: getTransactionsForUser now normalizes date/authorized_date to
  plain YYYY-MM-DD strings (new toDateString helper, unit-tested for
  the Date, string, and null arms; 100% coverage maintained)
- frontend: plaidMapping slices incoming dates to YYYY-MM-DD before
  parsing, so the UI is tolerant of both shapes regardless of which
  deploy lands first

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QeevtGJHrXu6XsJaAZNLWV
@railway-app
railway-app Bot temporarily deployed to alder / alder-pr-14 July 20, 2026 03:28 Destroyed
@super3
super3 merged commit 52afd48 into main Jul 20, 2026
3 checks passed
@super3
super3 deleted the claude/fern-mvp-design-adv0ks branch July 20, 2026 03:29
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.

2 participants