Input type date format "dd-MM-yyyy"

#1

I have an input type date

> <input type="date" ng-model="msg.payload.data1" id="date" name="Date" >

when i dispaly it in template mustache node, i get like this
date

i want to change the format of date. i have tried this code below but it doesn't work. it dispalays nothing.
{{payload.0.data1|date:'mediumDate'}

#2

Can't you reformat it in a function node or use the contrib-moment node?

#3

Sorry I did not know about the existence of that node. Thanks

#4
<input type="date" ng-model="msg.payload.data1" id="date" name="Date" >
{{msg.payload.data1 | date:'mediumDate'}}

This code works for me as expected. You refered that by payload.0.data1 but there is no array in your example.

1 Like