Add false return when repeats are empty (#8777)

* Add false return when repeats are empty

* Added front end check for repeats on monthly-daysOfWeek

* Fixed tests with static date
This commit is contained in:
Keith Holliday
2017-06-14 12:27:50 -06:00
committed by Sabe Jones
parent c084f8a2b9
commit f7ce269f3c
4 changed files with 43 additions and 5 deletions

View File

@@ -164,6 +164,7 @@ export function shouldDo (day, dailyTask, options = {}) {
let matchEveryX = differenceInMonths % dailyTask.everyX === 0;
if (dailyTask.weeksOfMonth && dailyTask.weeksOfMonth.length > 0) {
if (daysOfTheWeek.length === 0) return false;
schedule = schedule.every(daysOfTheWeek).daysOfWeek()
.every(dailyTask.weeksOfMonth).weeksOfMonthByDay();