21 lines
543 B
TypeScript
21 lines
543 B
TypeScript
export function formatGermanDate(dateString: string): string {
|
|
if (!dateString) return '';
|
|
|
|
return new Intl.DateTimeFormat('de-DE', {
|
|
day: 'numeric',
|
|
month: 'long',
|
|
year: 'numeric',
|
|
}).format(new Date(dateString));
|
|
}
|
|
|
|
export function formatCurrency(amount: number | null | undefined): string {
|
|
if (amount === null || amount === undefined) return 'N/A';
|
|
|
|
return new Intl.NumberFormat('de-DE', {
|
|
style: 'currency',
|
|
currency: 'EUR',
|
|
minimumFractionDigits: 0,
|
|
maximumFractionDigits: 0,
|
|
}).format(amount);
|
|
}
|