1 | import { Pipe, PipeTransform } from '@angular/core';
|
2 | import { Utils } from "./utils";
|
3 |
|
4 | 'date' } )
( { name: |
5 | export class DatePipe implements PipeTransform {
|
6 | transform( date: Date, pattern?: string ): string {
|
7 | if (!pattern) {
|
8 | pattern = "yyyy-MM-dd";
|
9 | }
|
10 | return Utils.formatDate(date, pattern);
|
11 | }
|
12 | }
|