I'd like to write something like
<p>{{"CURRENT_DATE" | translate:(value:(currentDate | date:getDateFormat))}}</p>
where translate
is a pipe function from ng2-translate.
I'd like to display: "Today is 2016-07-13", so CURRENT_DATE
is "Today is {{value}}"
and expects a dynamic value.
Depending on the user's locale, the current date format changes. I have a function getDateFormat
which returns "yy-MM-dd"
or "dd/MM/yy"
.
I know it is possible to chain pipes, but my case here is not really chaining pipes.
Is there a simple way, or do I have to write a custom pipe ?
Thanks !
EDIT: Okay my bad, I was too dumb to copy the example without errors. I should have written :
<p>{{"CURRENT_DATE" | translate:{value:currentDate | date:getDateFormat } }}</p>