I have a function that retrieves a list of items
getDate() {
this.http.get(this.url, this.httpOptions)
.subscribe((res: any ) => {
this.list = res.list;
this.list.forEach(element => {
return this.datePipe.transform(element.startTime, 'yyyy-MM-dd');
});
});
}
I want to format the date before displaying it. Is it possible to use DatePipe within the getDate function for this purpose?