Initial commit: buildfor_life_repair inventory system

SvelteKit + PostgreSQL app for tracking vintage computers, audio equipment,
components, and installation history. Features device/component CRUD, operation
logs, QR code labels, global search, image uploads, and dark mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 17:11:05 +07:00
commit 6f0e0ad6c6
64 changed files with 8996 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { format, formatDistanceToNow } from 'date-fns';
export function formatDate(date: Date | string | null): string {
if (!date) return '—';
const d = typeof date === 'string' ? new Date(date) : date;
return format(d, 'yyyy-MM-dd');
}
export function formatDateTime(date: Date | string | null): string {
if (!date) return '—';
const d = typeof date === 'string' ? new Date(date) : date;
return format(d, 'yyyy-MM-dd HH:mm');
}
export function timeAgo(date: Date | string | null): string {
if (!date) return '—';
const d = typeof date === 'string' ? new Date(date) : date;
return formatDistanceToNow(d, { addSuffix: true });
}