SEV-378: add tolerant formatDate/formatDateTime (v0.3.0) #3
Reference in New Issue
Block a user
Delete Branch "sev-378/format-date"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
formatDate/formatDateTimethat tolerate both SQLite"YYYY-MM-DD HH:MM:SS"(the shape our Go/Turso layer emits viadatetime('now'), whichnew 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
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>