import { Pipe , PipeTransform } from '@angular/core' ; import * as moment from 'moment' ; @ Pipe ( { name : 'date' } ) export class DatePipe implements PipeTransform { transform ( date , format = 'DD.MM.YYYY' ) { return moment ( date ) . format ( format ) ; } }