diff --git a/website/common/script/cron.js b/website/common/script/cron.js index b3171976c7..7195fc815c 100644 --- a/website/common/script/cron.js +++ b/website/common/script/cron.js @@ -140,7 +140,7 @@ export function shouldDo (day, dailyTask, options = {}) { } else if (dailyTask.frequency === 'monthly') { let schedule = moment(startDate).recur(); - let differenceInMonths = moment(day).month() + 1 - moment(startDate).month() + 1; + let differenceInMonths = moment(day).month() - moment(startDate).month(); let matchEveryX = differenceInMonths % dailyTask.everyX === 0; if (dailyTask.weeksOfMonth && dailyTask.weeksOfMonth.length > 0) { diff --git a/website/server/libs/taskManager.js b/website/server/libs/taskManager.js index 47d2811f58..3b2ea69531 100644 --- a/website/server/libs/taskManager.js +++ b/website/server/libs/taskManager.js @@ -26,7 +26,7 @@ async function _validateTaskAlias (tasks, res) { export function setNextDue (task, user) { if (task.type !== 'daily') return; - let optionsForShouldDo = cloneDeep(user.preferences.toObject()); + let optionsForShouldDo = user.preferences.toObject(); task.isDue = shared.shouldDo(Date.now(), task, optionsForShouldDo); optionsForShouldDo.nextDue = true; let nextDue = shared.shouldDo(Date.now(), task, optionsForShouldDo);