Reputation:
I'm in a server application comes date 12/07/2016 15:45:39
Now how do I get this format and template output 12.07.2016?
Markup
<div *ngFor="let data of item">
<p>{{data.created_at}}</p>
</div>
showing format
2016-12-07 15:45:39
and how to filter to get 2016-12-07 in template?
Upvotes: 2
Views: 487
Reputation: 136194
You could use DatePipe
with y.M.d
format.
<div *ngFor="let data of item">
<p>{{data.created_at | date: 'y.M.d'}}</p>
</div>
Upvotes: 2