import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'tempDate' }) /** * This pipe is created solely to address an IE11 bug where * the regular Angular Date pipe formatting string (date:'H:mm') is ignored * NOTE: After upgrading to Angular 5 - the IE11 bug should be resolved * and we can scrap this pipe * info: https://github.com/angular/angular/issues/10147 */ export class TempDatePipe implements PipeTransform { transform(value: string): string { if (value) { const date = new Date(value); let hours = date.getHours().toString(10); let minutes = date.getMinutes().toString(10); if (hours.length === 1) { hours = '0' + hours; } if (minutes.length === 1) { minutes = '0' + minutes; } value = hours + ':' + minutes; } return value; } }