I have a date in the timestamp format and I wanted to format it for Portuguese text, for example: "Wednesday, October 18, 2017", but I put the pipe "| date: 'fullDate'" and it does not work. When I take the toLocaleString("pt-BR")
and return a Date in the function it returns me "Wednesday, October 18, 2017". Thanks in advance!
Typescript
public dt: Date = new Date();
public getDate(): string {
return this.dt.toLocaleString("pt-BR");
}
html
<div class="data"><b>{{getDate() | date:'fullDate'}}</b></div>