Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// sets initial weekly hour totals until user changes value
setWeekTotals() {
let array = this.projectForm.get('projectTime').value
for (let i = 0; i < array.length; i++) {
let total = (Number(array[i].hoursHashMap.Sunday.hours)
+ Number(array[i].hoursHashMap.Monday.hours)
+ Number(array[i].hoursHashMap.Tuesday.hours)
+ Number(array[i].hoursHashMap.Wednesday.hours)
+ Number(array[i].hoursHashMap.Thursday.hours)
+ Number(array[i].hoursHashMap.Friday.hours)
+ Number(array[i].hoursHashMap.Saturday.hours));
this.projectWeekTotals.splice(i, 1, total);
this.getTotalHours();
this.project.emit(this.projectForm);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment