Please check the stackblitz. https://stackblitz.com/edit/timesheetgenerator?file=src/app/app.component.ts Whenever a number divisible by 8 is entered after the value which is di