Skip to content

Instantly share code, notes, and snippets.

@chasebaker21
Last active November 19, 2020 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasebaker21/7e6b3e92337399e60bfad3711583c23a to your computer and use it in GitHub Desktop.
Save chasebaker21/7e6b3e92337399e60bfad3711583c23a to your computer and use it in GitHub Desktop.
// 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