SEV-378: add tolerant formatDate/formatDateTime (v0.3.0) #3

Merged
bastian merged 1 commits from sev-378/format-date into main 2026-06-10 16:36:44 -04:00
Owner

Adds formatDate/formatDateTime that tolerate both SQLite "YYYY-MM-DD HH:MM:SS" (the shape our Go/Turso layer emits via datetime('now'), which new Date() can't parse → the admin "Invalid Date" bug) and RFC3339, returning '' for falsy/invalid. 12/12 tests pass. Bumps to v0.3.0; admin-site adopts it next (pin → this SHA).

🤖 Generated with Claude Code

Adds `formatDate`/`formatDateTime` that tolerate both SQLite `"YYYY-MM-DD HH:MM:SS"` (the shape our Go/Turso layer emits via `datetime('now')`, which `new Date()` can't parse → the admin "Invalid Date" bug) and RFC3339, returning `''` for falsy/invalid. 12/12 tests pass. Bumps to v0.3.0; admin-site adopts it next (pin → this SHA). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bastian added 1 commit 2026-06-10 16:36:38 -04:00
Our Go/Turso layer emits SQLite datetime('now') as "YYYY-MM-DD HH:MM:SS"
(UTC, no zone), which new Date() can't parse → "Invalid Date" in admin.
formatDate/formatDateTime normalize that shape (space→T + Z) and RFC3339,
returning '' for falsy/invalid. Tests cover both formats + empties.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bastian merged commit b7abf51087 into main 2026-06-10 16:36:44 -04:00
bastian deleted branch sev-378/format-date 2026-06-10 16:36:44 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SwitchEV/shared#3