mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 11:01:38 -05:00
30 lines
No EOL
927 B
JavaScript
30 lines
No EOL
927 B
JavaScript
Template.posts_digest.helpers({
|
|
posts: function(){
|
|
var postsView=sessionGetObject('postsView');
|
|
var collection=Posts.find(postsView.find);
|
|
return collection;
|
|
},
|
|
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
|
|
}
|
|
}); |