added next due date as today for weekly

This commit is contained in:
Keith Holliday
2017-05-20 18:38:53 -06:00
parent c08c0685f3
commit f49d21d7b4

View File

@@ -134,7 +134,7 @@ export function shouldDo (day, dailyTask, options = {}) {
schedule = schedule.every(daysOfTheWeek).daysOfWeek();
if (options.nextDue) {
let dates = schedule.fromDate(startOfDayWithCDSTime).next(6);
let dates = schedule.fromDate(startOfDayWithCDSTime.subtract('1', 'days')).next(6);
let filterDates = dates.filter((momentDate) => {
let weekDiff = momentDate.week() - moment(startDate).week();
let matchX = weekDiff % dailyTask.everyX === 0;