Include text in Angular 2+ Date Pipe format
May be you can create a simple pipe,
@Pipe({
name: 'dateFormatPipe',
})
export class dateFormatPipe implements PipeTransform {
transform(value: string) {
var datePipe = new DatePipe("en-US");
value = datePipe.transform(value, 'MMM-dd-yyyy') + ' at ' + datePipe.transform(value, 'hh:mm a');
return value;
}
}
<p>{{currentTime | dateFormatPipe}}</p>
Ref1 , Ref2
I had this exact situation. I was able to get it to work by surrounding the literal text with \'
{{my_date | date: 'yyyy/MM/dd \'at\' HH:mm:ss'}}