Simple Managment webapp [LLM]

This commit is contained in:
2025-12-03 17:20:50 +01:00
parent b521f74951
commit e7f613b5dc
76 changed files with 20009 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from '@angular/core';
import { formatDistanceToNow, parseISO } from 'date-fns';
@Pipe({
name: 'relativeTime',
standalone: true
})
export class RelativeTimePipe implements PipeTransform {
transform(value: string | Date | null | undefined): string {
if (!value) {
return '-';
}
try {
const date = typeof value === 'string' ? parseISO(value) : value;
return formatDistanceToNow(date, { addSuffix: true });
} catch {
return '-';
}
}
}