diff --git a/frontend/src/lib/geschichte/utils.ts b/frontend/src/lib/geschichte/utils.ts index 824ad996..36db9d05 100644 --- a/frontend/src/lib/geschichte/utils.ts +++ b/frontend/src/lib/geschichte/utils.ts @@ -3,22 +3,16 @@ import { formatDate } from '$lib/shared/utils/date'; type AuthorSummary = { firstName?: string; lastName?: string; email: string }; type AuthorView = { displayName: string }; -/** Format an author name from a list summary (firstName + lastName, falling back to email). */ export function formatAuthorName(author: AuthorSummary | null | undefined): string { if (!author) return ''; const full = [author.firstName, author.lastName].filter(Boolean).join(' ').trim(); return full || author.email || ''; } -/** Format an author displayName from a detail view. */ export function formatAuthorDisplayName(author: AuthorView | null | undefined): string { return author?.displayName ?? ''; } -/** - * Format a publishedAt ISO string to a localised date string. - * Returns null when publishedAt is absent. - */ export function formatPublishedAt( publishedAt: string | null | undefined, style: 'short' | 'long' = 'short'