import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'updateTime' } ) export class UpdateTimePipe implements PipeTransform { param creationTime { number } param advisoryTime { string } return { number } transform ( creationTime , advisoryTime ) { if ( advisoryTime === '1 Day' ) { return creationTime + 24 * 3600 * 1000 ; } else if ( advisoryTime === '1 Week' ) { return creationTime + 7 * 24 * 3600 * 1000 ; } else if ( advisoryTime === '1 Month' ) { return creationTime + 30 * 24 * 3600 * 1000 ; } else if ( advisoryTime === '1 Year' ) { return creationTime + 365 * 24 * 3600 * 1000 ; } else { return null ; } } }