my date got the format like this... Wed Sep 09 2015 11:43:40 GMT+0200 (CEST)
This is the way I insert the data into the mongodb...
Tasks.insert({
text: text,
gerätename: gerätenummer,
createdAt: new Date() // current time
});
But now I want only a the date format like day/month/year and time in the frontend.
What I have to change in the following code that it will work.
Template.body.helpers({
tasks: function () {
// Show newest tasks at the top
return Tasks.find({}, {sort: {createdAt: -1}});
}
});
<template name="task">
<li class="{{#if checked}}checked{{/if}}">
<button class="delete">×</button>
<input type="checkbox" checked="{{checked}}" class="toggle-checked" />
<span class="text">{{text}}</span>
<span class="text">{{gerätename}}</span>
<span clas="text">{{createdAt}}</span>
</li>
</template>
Thank you!