Vulcan/client/views/posts/posts_digest.js
Tom Coleman 218f76347b Refactored the subscriptions to be all separate.
Probably still a bit of work to do to get things up to scratch, but looking good.
2012-10-18 13:07:10 +11:00

28 lines
No EOL
834 B
JavaScript

Template.posts_digest.helpers({
posts: function(){
return digestPosts();
},
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
}
});