Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let totalInput = 0;
- let totalOutput = 0;
- day.totalCost = 0;
- for (let i = 0; i < this.events.length; i++) {
- if (day.date.getDate() === this.events[i].start.getDate()) {
- if (this.events[i].color === colors.green) {
- totalInput = totalInput + this.events[i].amount;
- } else if (this.events[i].color === colors.red) {
- totalOutput = totalOutput - this.events[i].amount;
- }
- }
- this.dayTotal = (totalInput - totalOutput);
- day.totalCost = this.dayTotal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement