Fix display of report ID and status on the by-id page.

This commit is contained in:
Eli Ribble 2026-04-09 13:48:48 +00:00
parent 882636de8f
commit cb9e5146bf
No known key found for this signature in database
2 changed files with 14 additions and 5 deletions

View file

@ -54,6 +54,12 @@ export function formatRelativeTime(dateString: string): string {
if (diffHours < 24) return `${diffHours} hour${diffHours > 1 ? "s" : ""} ago`;
return `${diffDays} day${diffDays > 1 ? "s" : ""} ago`;
}
export function formatReportID(id: string): string {
if (id.length === 12) {
return `${id.substring(0, 4)}-${id.substring(4, 8)}-${id.substring(8)}`;
}
return id;
}
export function formatTimeRelative(t: Date): string {
const now = new Date();
const diffMs = now.getTime() - t.getTime();