Use humanizeDuration directly in the template

This commit is contained in:
Ricardo Gonzalez
2020-10-16 21:52:03 +01:00
parent 96534c44b7
commit 78d0dd8f3b
4 changed files with 7 additions and 27 deletions
@@ -185,16 +185,6 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
return item.id || index;
}
humanizeHours(hours: number, full: boolean = false): string {
let duration: string = ''
if(!hours){
return '--'
}
if(!full){
duration = humanizeDuration(hours * 60 * 60 * 1000, { round: true, largest: 1, units: ['y', 'd', 'h', 'm', 's'] });
} else {
duration = humanizeDuration(hours * 60 * 60 * 1000, { conjunction: " and ", serialComma: false });
}
return duration
}
readonly humanizeDuration = humanizeDuration;
}