mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 20:16:39 -04:00
28 lines
No EOL
823 B
JavaScript
28 lines
No EOL
823 B
JavaScript
Template.logs.helpers({
|
|
getTime: function () {
|
|
return moment(this.timestamp).format("HH:mm:ss");
|
|
},
|
|
getDate: function () {
|
|
currentDate = moment(this.timestamp).format("MMMM DD");
|
|
return currentDate;
|
|
},
|
|
searchCount: function () {
|
|
// TODO: doesn't work properly with "load more"
|
|
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"));
|
|
},
|
|
loadMoreUrl: function(){
|
|
var count = parseInt(Session.get('logsLimit')) + 100;
|
|
return '/logs/' + count;
|
|
},
|
|
}); |