datasurvey/src/main/webapp/app/shared/date/format-medium-date.pipe.ts

13 lines
300 B
TypeScript
Raw Normal View History

2021-07-03 21:48:27 +00:00
import { Pipe, PipeTransform } from '@angular/core';
import * as dayjs from 'dayjs';
@Pipe({
name: 'formatMediumDate',
})
export class FormatMediumDatePipe implements PipeTransform {
transform(day: dayjs.Dayjs | null | undefined): string {
return day ? day.format('D MMM YYYY') : '';
}
}