Prevented modal close and showed correct due class in modal

This commit is contained in:
Keith Holliday
2017-06-16 12:28:42 -06:00
parent 7a8857010e
commit 136dcd27a9
3 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import {
shouldDo,
} from '../cron';
import moment from 'moment';
/*
Task classes given everything about the class
@@ -8,7 +9,7 @@ Task classes given everything about the class
// TODO move to the client
module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCron = Number(new Date()), showCompleted = false, main = false) {
module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCron = Number(new Date()), showCompleted = false, main = false, processingYesterdailies = false) {
if (!task) {
return '';
}
@@ -34,7 +35,9 @@ module.exports = function taskClasses (task, filters = [], dayStart = 0, lastCro
}
if (type === 'todo' || type === 'daily') {
let notDue = !shouldDo(Number(new Date()), task, { dayStart });
let dayShouldDo = moment();
if (processingYesterdailies) dayShouldDo.subtract(1, 'days');
let notDue = !shouldDo(Number(dayShouldDo), task, { dayStart });
let isNotDueDaily = type === 'daily' && notDue;
if (completed || isNotDueDaily) {