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