Vulcan/packages/telescope-daily/lib/client/templates/posts_daily.js

37 lines
896 B
JavaScript
Raw Normal View History

Meteor.startup(function () {
Template[getTemplate('postsDaily')].helpers({
days: function () {
var daysArray = [];
// var days = this.days;
var days = Session.get('postsDays');
for (i = 0; i < days; i++) {
daysArray.push({
date: moment().subtract(i, 'days').startOf('day').toDate(),
index: i
});
}
return daysArray;
},
before_day: function () {
return getTemplate('beforeDay');
},
2015-01-08 17:37:54 +09:00
singleDay: function () {
return getTemplate('singleDay');
},
context: function () {
var context = this;
context.showDateNav = false;
return context;
},
after_day: function () {
return getTemplate('afterDay');
},
2015-01-08 17:37:54 +09:00
loadMoreDaysUrl: function () {
var count = parseInt(Session.get('postsDays')) + daysPerPage;
return '/daily/' + count;
2014-08-27 09:24:37 +09:00
}
});
});