Reformatted client.js

This commit is contained in:
Yaman Qalieh 2016-05-07 17:20:35 -04:00
parent 011068af59
commit c846da2ab8

View File

@ -10,12 +10,22 @@ Meteor.subscribe('schedule');
Template.client.helpers({ Template.client.helpers({
sched: function() { sched: function() {
beforeslice = schedule.find({}, {sort: {timestamp: 1}, limit: 9}).fetch(); beforeslice = schedule.find({}, {
sort: {
timestamp: 1
},
limit: 9
}).fetch();
return beforeslice.slice(1, beforeslice.length); return beforeslice.slice(1, beforeslice.length);
}, },
mostrecent: function() { mostrecent: function() {
return schedule.find({}, {sort: {timestamp: 1}, limit: 1}).fetch(); return schedule.find({}, {
sort: {
timestamp: 1
},
limit: 1
}).fetch();
} }
}); });
@ -75,7 +85,7 @@ Template.day.helpers({
lastWeek: '[Last] dddd', lastWeek: '[Last] dddd',
sameElse: 'MM/DD/YYYY' sameElse: 'MM/DD/YYYY'
}); });
if (this.day != undefined) { if (this.day !== undefined) {
date = date + " (" + this.day + ")" date = date + " (" + this.day + ")"
} }
return date return date
@ -190,6 +200,11 @@ function getScale(index, start) {
Template.phone.helpers({ Template.phone.helpers({
phone: function() { phone: function() {
return schedule.find({}, {sort: {timestamp: 1}, limit: 10}).fetch(); return schedule.find({}, {
sort: {
timestamp: 1
},
limit: 10
}).fetch();
} }
}); });