2012-10-10 13:54:48 +09:00
|
|
|
Template.posts_digest.helpers({
|
|
|
|
posts: function(){
|
2012-10-09 12:02:37 +09:00
|
|
|
var postsView=sessionGetObject('postsView');
|
2012-10-10 13:54:48 +09:00
|
|
|
var collection=Posts.find(postsView.find);
|
|
|
|
return collection;
|
2012-10-09 12:02:37 +09:00
|
|
|
},
|
2012-10-10 13:54:48 +09:00
|
|
|
currentDate: function(){
|
|
|
|
return moment(sessionGetObject('currentDate')).format("dddd, MMMM Do YYYY");
|
|
|
|
},
|
|
|
|
previousDateURL: function(){
|
|
|
|
var currentDate=moment(sessionGetObject('currentDate'));
|
|
|
|
var newDate=currentDate.subtract('days', 1);
|
|
|
|
return getDigestURL(newDate);
|
|
|
|
},
|
|
|
|
showPreviousDate: function(){
|
|
|
|
// TODO
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
nextDateURL: function(){
|
|
|
|
var currentDate=moment(sessionGetObject('currentDate'));
|
|
|
|
var newDate=currentDate.add('days', 1);
|
|
|
|
return getDigestURL(newDate);
|
|
|
|
},
|
|
|
|
showNextDate: function(){
|
|
|
|
var currentDate=moment(sessionGetObject('currentDate'));
|
|
|
|
var nextDate=currentDate.add('days', 1);
|
|
|
|
var today=moment(new Date());
|
|
|
|
return today.diff(nextDate, 'days') > 0
|
2012-10-09 12:02:37 +09:00
|
|
|
}
|
2012-10-10 13:54:48 +09:00
|
|
|
});
|