17 lines
286 B
TypeScript
17 lines
286 B
TypeScript
import {Pipe, PipeTransform} from '@angular/core';
|
|
|
|
@Pipe({
|
|
name: 'seconds'
|
|
})
|
|
export class SecondsPipe implements PipeTransform {
|
|
|
|
transform(value: any, args?: any): any {
|
|
if (value) {
|
|
return ((value / 1000) % 60).toFixed(2);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|