Skip to content

T-132 β€” Unify Records page date format to MMM DD, YYYY

Why this exists

The owner reported that date columns across the Records page tabs display in inconsistent formats. Specifically, the Service Invoices tab was showing raw ISO strings ("2026-06-07") while other tabs (WOPCs, Project Invoices, Coaching Invoices) showed "7 Jun 2026" (day-first, no zero-padding). Neither matched the app-wide standard "Jun 07, 2026" (MMM DD, YYYY) documented in AGENTS.md.

Audit found three distinct date formats in active use: 1. Raw ISO YYYY-MM-DD β€” ExpenseRecordsTab (Invoice / Receipt Date column) 2. en-HK locale β†’ "D Mon YYYY" (day-first, no zero-pad) β€” RecordsApp formatDate() (used by WOPCs Issue Date, Project Invoice Date/Cleared, Coaching Invoice Date/Cleared) and BankStatementsTab formatPeriodDate() 3. Correct en-US day:'2-digit' β†’ "Mon DD, YYYY" β€” IR56MFilingsTab fmtDate() (already correct) and RecordsApp's formatCsvDate() (CSV export, already correct)

Root cause

RecordsApp.formatDate() and BankStatementsTab.formatPeriodDate() both used toLocaleDateString('en-HK', …) which formats as "D Mon YYYY" in Node/V8. The ExpenseRecordsTab date column had no formatter at all β€” it passed the raw ISO string to React.

Fix (commit below)

  • RecordsApp.tsx formatDate (line ~245): switched locale from en-HK to en-US and added day: '2-digit' β€” fixes Issue Date (WOPCs), Invoice Date and Cleared (Project + Coaching Invoices) in one change.
  • BankStatementsTab.tsx formatPeriodDate (line ~54): same locale fix β€” fixes the period start/end dates in the Bank Statements tab.
  • ExpenseRecordsTab.tsx: added a formatDate() helper (identical pattern to the now-fixed RecordsApp version) and replaced the raw-value render in dateCol with formatDate(v). Sorter unchanged β€” it compares raw ISO strings via localeCompare, which sorts correctly.

Legacy tabs (ReceiptsTab.tsx, VendorInvoicesTab.tsx) also had raw ISO dates but are not rendered anywhere in the active UI (only their type exports are imported) β€” no change needed.

Decision log

2026-06-29 β€” βœ… Read AGENTS.md before opening this task. Source: Records (Infrastructure) Β· https://claude.ai/code/session_018RDB37kCqfouHdygVXTAtD

Owner requested the fix. Three files changed; fix is mechanical (locale/format string only β€” no data-shape or API changes). Verified: no sorter impact because all active date sorters compare raw ISO strings, not formatted display strings.

Close-out

Status: done Commit: see git log β€” fix pushed to claude/friendly-newton-bLnSw under PR #819. Blast radius: Records page tabs β€” WOPCs, Project Invoices, Coaching Invoices, Service Invoices, Bank Statements. IR56M Filings unaffected (already correct). No API or data-shape changes.

Commit index (backfilled 2026-07-01, best-effort Β· Coaching (Diagnostic))

Candidate related commits, auto-backfilled from git on main: commits whose message references this task's UID or a PR number it cites. Not verified β€” this squash-merged history can't yield a precise per-task list, so rows tagged (mentions only) name the task in passing (may be tangential) and untagged work commits may be missing. Treat as a starting point: verify, prune tangential rows, and append any real ones per the AGENTS.md "record every related SHA" policy.

  • b654916 2026-06-29 β€” fix(accounting): clear dangling WOPC ref so withdrawn-WOPC txs can unmatch (T-132)
  • 879bf86 2026-06-29 β€” fix(records): unify date format (T-132) + batch-ZIP same-origin fetch (I-017)
  • 9c916db 2026-06-30 β€” Merge PR #819: WOPC viewer fix + unified dates + batch-ZIP CORS + IR56M status mirror
  • 508afa6 2026-06-30 β€” Merge remote-tracking branch 'origin/main' into claude/busy-dirac-QmUdM (mentions only)