mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-09-30 19:23:15 +00:00
19 lines
561 B
TypeScript
19 lines
561 B
TypeScript
|
|
export function formatCurrency(amount: number): string {
|
||
|
|
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function formatDate(iso: string): string {
|
||
|
|
return new Date(iso).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
||
|
|
}
|
||
|
|
|
||
|
|
export function formatDateTime(iso: string | null): string {
|
||
|
|
if (!iso) return '-';
|
||
|
|
return new Date(iso).toLocaleString('en-US', {
|
||
|
|
month: 'short',
|
||
|
|
day: 'numeric',
|
||
|
|
year: 'numeric',
|
||
|
|
hour: 'numeric',
|
||
|
|
minute: '2-digit',
|
||
|
|
});
|
||
|
|
}
|