import { Pipe , PipeTransform } from '@angular/core' ; import { FormatterService } from '@core/formatter.service' ; @ Pipe ( { name : 'eventDateTime' } ) export class EventDateTimePipe implements PipeTransform { constructor ( public formatter ) { } param event return transform ( event ) { let date ; try { date = new Date ( parseFloat ( event . properties . time ) ) ; } catch ( e ) { date = null ; } return this . formatter . dateTime ( date ) ; } }