Vulcan/client/views/admin/logs.js

27 lines
771 B
JavaScript
Raw Normal View History

2013-11-22 14:20:47 +09:00
Template.logs.helpers({
2013-11-22 14:46:42 +09:00
getTime: function () {
return moment(this.timestamp).format("hh:mm:ss");
},
getDate: function () {
currentDate = moment(this.timestamp).format("MMMM DD");
return currentDate;
},
searchCount: function () {
var after = moment(this.timestamp).startOf('day').valueOf(),
before = moment(this.timestamp).endOf('day').valueOf();
return Searches.find({
timestamp: {
$gte: after,
$lt: before
}
}).count();
},
isNewDate: function () {
return (typeof currentDate === 'undefined') ? true : (currentDate !== moment(this.timestamp).format("MMMM DD"));
2013-11-22 14:20:47 +09:00
},
loadMoreUrl: function(){
var count = parseInt(Session.get('logsLimit')) + 100;
return '/logs/' + count;
},
});