Fix "Invalid date" on synced transactions#14
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connecting a Sandbox bank worked, but every synced transaction rendered "Invalid Date" for its day label and date line.
Root cause
pgreturns PostgresDATEcolumns as JSDateobjects, sores.jsonserialized transaction dates as full ISO timestamps ("2026-07-18T00:00:00.000Z") instead of theYYYY-MM-DDthe API contract intends. The frontend then built"<iso-timestamp>T00:00:00"strings, whichnew Date(...)parses as Invalid Date.Fix (both ends)
getTransactionsForUsernormalizesdateandauthorized_dateto plainYYYY-MM-DDstrings via a newtoDateStringhelper (handlesDate, string, andnull; unit tests cover all three arms, 100% coverage maintained — 52 tests passing).plaidMapping.tsslices incoming dates toYYYY-MM-DDbefore 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