2015-04-22 07:50:11 +09:00
|
|
|
// Controller for post digest
|
|
|
|
|
2015-05-07 15:44:12 +09:00
|
|
|
Posts.controllers.singleday = Posts.controllers.list.extend({
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-05-07 15:44:12 +09:00
|
|
|
view: 'singleday',
|
|
|
|
|
|
|
|
template: 'single_day', // use single_day template to get prev/next day navigation
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
data: function() {
|
|
|
|
var currentDate = this.params.day ? new Date(this.params.year, this.params.month-1, this.params.day) : Session.get('today');
|
2015-05-07 15:44:12 +09:00
|
|
|
var terms = {
|
|
|
|
view: 'singleday',
|
|
|
|
date: currentDate,
|
|
|
|
after: moment(currentDate).startOf('day').toDate(),
|
|
|
|
before: moment(currentDate).endOf('day').toDate()
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-05-07 15:44:12 +09:00
|
|
|
return {terms: terms};
|
2015-04-22 07:50:11 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Meteor.startup(function () {
|
|
|
|
|
|
|
|
// Digest
|
|
|
|
|
|
|
|
Router.route('/day/:year/:month/:day', {
|
|
|
|
name: 'postsSingleDay',
|
2015-05-07 15:44:12 +09:00
|
|
|
controller: Posts.controllers.singleday
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
Router.route('/day', {
|
|
|
|
name: 'postsSingleDayDefault',
|
2015-05-07 15:44:12 +09:00
|
|
|
controller: Posts.controllers.singleday
|
2015-04-22 07:50:11 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|