import { DatePipe } from '@angular/common' ; import { Component , Input } from '@angular/core' ; @ Component ( { selector : 'dv-show-date' , templateUrl : './show-date.component.html' , providers : [ DatePipe ] } ) export class ShowDateComponent { _date : Date ; @ Input ( ) set date ( d ) { this . _date = new Date ( < string > d ) ; } @ Input ( ) format = 'EEE MMM d, y h:mm a' ; }