import { NgModule , Pipe , PipeTransform } from '@angular/core' ; import { Locale } from 'date-fns' ; import parse from 'date-fns/parse' ; import { calculateLocale , DateFnsConfigurationService } from './date-fns-configuration.service' ; import { DateFnsInputDate } from './types' ; @ Pipe ( { name : 'dfnsParsePure' } ) export class ParsePurePipe implements PipeTransform { constructor ( public config ) { } transform ( dateString , formatString , backupDate , options ? ) { return parse ( dateString , formatString , backupDate , calculateLocale ( options , this . config ) ) ; } } @ NgModule ( { declarations : [ ParsePurePipe ] , exports : [ ParsePurePipe ] } ) export class ParsePurePipeModule { }