Angular 2 date pipe

Tim Liberty

I am using this code:

{{today | date:'General.dateFormat | translate'}}

where General.dateFormat is a format MM.dd.yyyy stored in my language JSON file. But it is printed as 5 22, 2017 AenerPMl.22PMteFor35PMt | trPMn24lPMte

I think there is an issue with multiple pipe. If I replace General.dateFormat | translate with MM.dd.yyyy it works as it should. How do I give the format from my language json file using the translate pipe?

Shahid Ahmad

You passed translate pipe as a value to date filters. pass value directly instead of passing General.dateFormat as a string. please try the below code

{{today | date: translate:'General.dateFormat'}}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related