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