mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
38 lines
897 B
JavaScript
38 lines
897 B
JavaScript
/**
|
|
* Controller for single day view
|
|
*/
|
|
Posts.controllers.singleday = Posts.controllers.list.extend({
|
|
|
|
view: 'singleday',
|
|
|
|
template: 'single_day', // use single_day template to get prev/next day navigation
|
|
|
|
data: function() {
|
|
var currentDate = this.params.day ? new Date(this.params.year, this.params.month-1, this.params.day) : Session.get('today');
|
|
var terms = {
|
|
view: 'singleday',
|
|
date: currentDate,
|
|
after: moment(currentDate).startOf('day').toDate(),
|
|
before: moment(currentDate).endOf('day').toDate(),
|
|
enableCache: true
|
|
};
|
|
return {terms: terms};
|
|
},
|
|
|
|
});
|
|
|
|
Meteor.startup(function () {
|
|
|
|
// Digest
|
|
|
|
Router.route('/day/:year/:month/:day', {
|
|
name: 'postsSingleDay',
|
|
controller: Posts.controllers.singleday
|
|
});
|
|
|
|
Router.route('/day', {
|
|
name: 'postsSingleDayDefault',
|
|
controller: Posts.controllers.singleday
|
|
});
|
|
|
|
});
|