import { NgModule , Pipe , PipeTransform } from '@angular/core' ; import { DateFnsInputDate } from './types' ; import differenceInMilliseconds from 'date-fns/differenceInMilliseconds' ; @ Pipe ( { name : 'dfnsDifferenceInMilliseconds' } ) export class DifferenceInMillisecondsPipe implements PipeTransform { transform ( dateLeft , dateRight ) { return differenceInMilliseconds ( dateLeft , dateRight ) ; } } @ NgModule ( { declarations : [ DifferenceInMillisecondsPipe ] , exports : [ DifferenceInMillisecondsPipe ] } ) export class DifferenceInMillisecondsPipeModule { }