Add support for date-only to the time-display component

This commit is contained in:
Joseph Schorr 2017-11-27 13:08:38 +02:00
parent 89d635f6cf
commit b5b4aa154c
3 changed files with 11 additions and 2 deletions

View file

@ -9,4 +9,13 @@ import { Input, Component } from 'ng-metadata/core';
})
export class TimeDisplayComponent {
@Input('<') public datetime: any;
@Input('<') public dateOnly: boolean;
private getFormat(dateOnly: boolean): string {
if (dateOnly) {
return 'dddd, MMMM Do YYYY';
}
return 'dddd, MMMM Do YYYY, h:mm A';
}
}