Added the reccuring todos that repeat weekly to be created for the next 52 weeks

This commit is contained in:
Dejan
2024-11-04 23:32:13 +01:00
parent 5beadcce01
commit dbfe7d6e9c
2 changed files with 2 additions and 3 deletions

View File

@ -61,9 +61,8 @@ export const useCreateTodo = () => {
dates.push(newDate); dates.push(newDate);
}); });
// TODO: for the next 52 weeks
let index = 1; let index = 1;
for (let i = 0; i < 4; i++) { for (let i = 0; i < 52; i++) {
dates?.forEach((dateToAdd) => { dates?.forEach((dateToAdd) => {
index ++; index ++;
let newTodoDate = addWeeks(dateToAdd, i); let newTodoDate = addWeeks(dateToAdd, i);

View File

@ -73,7 +73,7 @@ export const useUpdateTodo = () => {
dates.push(newDate); dates.push(newDate);
}); });
let todosToAddCycles = 4; let todosToAddCycles = 52;
if (firstTodo?.repeatType === REPEAT_TYPE.EVERY_WEEK) { if (firstTodo?.repeatType === REPEAT_TYPE.EVERY_WEEK) {
todosToAddCycles = filteredTodos?.length / firstTodo?.repeatDays?.length; todosToAddCycles = filteredTodos?.length / firstTodo?.repeatDays?.length;
} }