File

src/app/shared/pipes/cd-date.pipe.ts

Metadata

Name cdDate

Methods

transform
transform(value: any)
Parameters :
Name Type Optional
value any No
Returns : any
import { DatePipe } from '@angular/common';
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'cdDate'
})
export class CdDatePipe implements PipeTransform {
  constructor(private datePipe: DatePipe) {}

  transform(value: any): any {
    if (value === null || value === '') {
      return '';
    }
    return (
      this.datePipe.transform(value, 'shortDate') +
      ' ' +
      this.datePipe.transform(value, 'mediumTime')
    );
  }
}

result-matching ""

    No results matching ""