initial commit

This commit is contained in:
Joakim Repomaa
2026-02-17 02:15:25 +02:00
commit 72a636d175
55 changed files with 6171 additions and 0 deletions

10
src/lib/utils/date.ts Normal file
View File

@@ -0,0 +1,10 @@
/**
* Format a year-month date string to display just the year
* @param dateStr - Date string in YYYY-MM format, or undefined for 'Present'
* @returns Formatted year or 'Present'
*/
export function formatDate(dateStr: string | undefined): string {
if (!dateStr) return 'Present';
const date = new Date(dateStr + '-01');
return date.toLocaleDateString('en-US', { year: 'numeric' });
}