I need to display a date from database in the format 'mm-dd-yyyy'. As its saved in ISO format in mongodb
how can I convert it in the template ?
Here is my code.
Template.templatename.vname = function () {
return Posts.find();
}
And in template
{{#each vname}}
{{ date }}
{{/each}}
Now its getting displayed like Tue Feb 04 2014 00:00:00 GMT+0530 (IST)
I need to show it as mm-dd-yyyy
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…