mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Allow user to deselect all days during week
This commit is contained in:
@@ -393,10 +393,11 @@ angular.module('habitrpg')
|
||||
var options = angular.copy(user);
|
||||
options.nextDue = true;
|
||||
var nextDueDates = Shared.shouldDo(new Date, task, options);
|
||||
if (!nextDueDates) return '';
|
||||
|
||||
let dateFormat = 'MM-DD-YYYY';
|
||||
if (user.preferences.dateFormat) dateFormat = user.preferences.dateFormat.toUpperCase();
|
||||
console.log(dateFormat);
|
||||
|
||||
var nextDue = nextDueDates.map(function (date) {
|
||||
return date.format(dateFormat);
|
||||
});
|
||||
|
||||
@@ -131,6 +131,7 @@ export function shouldDo (day, dailyTask, options = {}) {
|
||||
let differenceInWeeks = moment(startOfDayWithCDSTime).week() - moment(startDate).week();
|
||||
let matchEveryX = differenceInWeeks % dailyTask.everyX === 0;
|
||||
|
||||
if (daysOfTheWeek.length === 0) return false;
|
||||
schedule = schedule.every(daysOfTheWeek).daysOfWeek();
|
||||
|
||||
if (options.nextDue) {
|
||||
|
||||
Reference in New Issue
Block a user