Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. let totalInput = 0;
  2. let totalOutput = 0;
  3. day.totalCost = 0;
  4.  
  5. for (let i = 0; i < this.events.length; i++) {
  6. if (day.date.getDate() === this.events[i].start.getDate()) {
  7. if (this.events[i].color === colors.green) {
  8. totalInput = totalInput + this.events[i].amount;
  9. } else if (this.events[i].color === colors.red) {
  10. totalOutput = totalOutput - this.events[i].amount;
  11. }
  12. }
  13. this.dayTotal = (totalInput - totalOutput);
  14. day.totalCost = this.dayTotal;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement