SEV-378: add tolerant formatDate/formatDateTime to shared (v0.3.0)

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>
This commit is contained in:
Bastian de Byl
2026-06-10 16:36:24 -04:00
parent 2b54028495
commit e405985c34
4 changed files with 47 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@switchev/web-shared",
"version": "0.2.0",
"version": "0.3.0",
"description": "Shared browser helpers (formatters, markdown, image polling) for the SwitchEV frontends",
"type": "module",
"exports": {