mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-07 04:42:00 +00:00
Move STATUS_COLORS and PRIORITY_COLORS to constants/index.ts and formatCurrency/formatDate/formatDateTime to lib/format.ts — previously duplicated across 5 and 4 files respectively. AdminDashboard: Wire Category and Priority filter dropdowns to usePaginatedList extraParams (were no-op onChange handlers). ProposalDetailPage: Add 'Revised' to STATUS_ORDER so the stepper renders correctly for revised proposals.
18 lines
561 B
TypeScript
18 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',
|
|
});
|
|
}
|