import { NgModule , Pipe , PipeTransform } from '@angular/core' ; import { DateFnsInputDate , DateFnsWeekIndex } from './types' ; import differenceInCalendarWeeks from 'date-fns/differenceInCalendarWeeks' ; @ Pipe ( { name : 'dfnsDifferenceInCalendarWeeks' } ) export class DifferenceInCalendarWeeksPipe implements PipeTransform { transform ( dateLeft , dateRight , options ? ) { return differenceInCalendarWeeks ( dateLeft , dateRight , options ) ; } } @ NgModule ( { declarations : [ DifferenceInCalendarWeeksPipe ] , exports : [ DifferenceInCalendarWeeksPipe ] } ) export class DifferenceInCalendarWeeksPipeModule { }