feat/issue-751-journey-item-crud-api #791

Merged
marcel merged 69 commits from feat/issue-751-journey-item-crud-api into feat/issue-750-lesereisen-data-model 2026-06-09 12:08:58 +02:00
Showing only changes of commit 930f69e884 - Show all commits

View File

@@ -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'