Vulcan/client/views/posts/posts_digest.js

28 lines
834 B
JavaScript
Raw Normal View History

2012-10-10 13:54:48 +09:00
Template.posts_digest.helpers({
posts: function(){
return digestPosts();
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
});