feat(frontend): modernize Angular app

This commit is contained in:
Pierre Nédélec
2025-12-15 01:56:47 +01:00
parent 03f1fa106a
commit 183c4ba898
52 changed files with 8215 additions and 16157 deletions

View File

@@ -0,0 +1,21 @@
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: 'eta',
})
export class EtaPipe implements PipeTransform {
transform(value: number): string | null {
if (value === null) {
return null;
}
if (value < 60) {
return `${Math.round(value)}s`;
}
if (value < 3600) {
return `${Math.floor(value/60)}m ${Math.round(value%60)}s`;
}
const hours = Math.floor(value/3600)
const minutes = value % 3600
return `${hours}h ${Math.floor(minutes/60)}m ${Math.round(minutes%60)}s`;
}
}