Removed extra codes

This commit is contained in:
Keith Holliday
2017-05-12 09:21:29 -06:00
parent f192ca4c6f
commit a82b60f144
2 changed files with 2 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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);