refactor(frontend): apply formatDate utility and fix derived/error handling
- Replace 5 inline Intl.DateTimeFormat blocks with formatDate() across home, conversations, persons detail, and document detail pages - Fix coCorrespondents: $derived(() => ...) → $derived.by(...) — the old form typed the value as a function, breaking template call sites - Persons list: throw error on API failure instead of silently returning [] Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
import { formatDate } from '$lib/utils/date';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -119,7 +120,7 @@
|
||||
</span>
|
||||
<div>
|
||||
<span class="block font-serif text-lg text-brand-navy">
|
||||
{doc.documentDate ? new Intl.DateTimeFormat('de-DE', { day: 'numeric', month: 'long', year: 'numeric' }).format(new Date(doc.documentDate + 'T12:00:00')) : '—'}
|
||||
{doc.documentDate ? formatDate(doc.documentDate) : '—'}
|
||||
</span>
|
||||
<span class="text-xs font-sans text-gray-500">{m.doc_label_document_date()}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user