Reputation: 103
How can I get the today's date and time like this DD.MM.YYYY and how to do it? in Meteor?
Template.getdate.helpers({
datelist: function(){
var bugun=date(now);
return Rezervasyon.find({iadetarihi:bugun});
}
});
Upvotes: 3
Views: 3959
Reputation: 75945
You can use the standard javascript for today's date:
var bugun=new Date();
To format it and get more fine grained options it's nice to use the momentjs package:
Add this to your meteor project:
meteor add momentjs:moment
You can then do this instead of the above:
var date = new Date()
var begun = moment(date).format("MM.DD.YYYY");
Upvotes: 6