mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
31 lines
No EOL
899 B
JavaScript
31 lines
No EOL
899 B
JavaScript
Template.posts_digest.helpers({
|
|
posts: function(){
|
|
return digestPosts();
|
|
},
|
|
hasPosts: function(){
|
|
return !!digestPosts().length;
|
|
},
|
|
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
|
|
}
|
|
}); |