mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Removed extra codes
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user