Fix display of report ID and status on the by-id page.
This commit is contained in:
parent
882636de8f
commit
cb9e5146bf
2 changed files with 14 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue