diff --git a/www7/sites/all/modules/date/date_repeat/date_repeat_calc.inc b/www7/sites/all/modules/date/date_repeat/date_repeat_calc.inc index 2a02d94..e7ecca1 100644 --- a/www7/sites/all/modules/date/date_repeat/date_repeat_calc.inc +++ b/www7/sites/all/modules/date/date_repeat/date_repeat_calc.inc @@ -238,6 +238,11 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi } } ksort($week_days); + // patch by Ron. This is needed if weekly interval > 1. Otherwise if start date is the first of the days selected the + // weeks are not selected correctly. That is, if start date is Monday 2014-04-28, and days are MO-FR, and weekly + // interval is 2, 2014-04-28 will be selected, but instead of TU-FR of that week, the next week days will be + // selected. + $day = reset($rrule['BYDAY']); // BYDAYs with parameters like -1SU (last Sun) or 2TH (second Thur) // need to be processed one month or year at a time.