diff --git a/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.html b/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.html index eea68fe5..88d78b54 100644 --- a/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.html +++ b/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.html @@ -74,9 +74,9 @@ - Traveled time + Traveled time (hh:mm) - {{ durationFormatter(item.traveledTime) }} + {{ formattedTravelTime(item.traveledTime) }} diff --git a/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.ts b/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.ts index 878f9df1..a6c34006 100644 --- a/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.ts +++ b/application/frontend/src/app/routes-metadata/components/base-routes-metadata-table/base-routes-metadata-table.component.ts @@ -18,7 +18,10 @@ import { ViewEncapsulation, } from '@angular/core'; import { DataSource } from 'src/app/shared/models'; -import { formatDuration, getCapacityQuantityUnit, getUnitAbbreviation } from 'src/app/util'; +import { + getCapacityQuantityUnit, + getUnitAbbreviation, +} from 'src/app/util'; import { RouteMetadata } from '../../models'; import { selectAllowExperimentalFeatures } from '../../../../app/core/selectors/config.selectors'; import { Store } from '@ngrx/store'; @@ -44,7 +47,6 @@ export class BaseRoutesMetadataTableComponent implements OnInit { @Output() sortChange = new EventEmitter<{ active: string; direction: string }>(); allowExperimentalFeatures: boolean; - durationFormatter = formatDuration; objectKeys = Object.keys; constructor(private store: Store, private zone: NgZone) {} @@ -83,4 +85,10 @@ export class BaseRoutesMetadataTableComponent implements OnInit { onSortChange(value: { active: string; direction: string }): void { this.zone.run(() => this.sortChange.emit(value)); } + + formattedTravelTime(seconds: number): string { + const hours = Math.floor(seconds / 3600); + const minutes = Math.floor((seconds - hours * 3600) / 60); + return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`; + } }