import { Pipe , PipeTransform } from '@angular/core' ; import dayjs from 'dayjs/esm' ; @ Pipe ( { name : 'duration' , } ) export class DurationPipe implements PipeTransform { transform ( value ) { if ( value ) { return dayjs . duration ( value ) . humanize ( ) ; } return '' ; } }