Commit 76e4de31 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-25505 Tasks: Fix for scheduled task bug on the last day of the month.

On the last day of the month, the scheduled task next time calculation was wrapping
to the 0th day of the month (which is not a valid day).
parent d0b114f9
......@@ -276,7 +276,7 @@ abstract class scheduled_task extends task_base {
$validhours = $this->eval_cron_field($this->hour, 0, 23);
$daysinmonth = date("t");
$validdays = $this->eval_cron_field($this->day, 0, $daysinmonth);
$validdays = $this->eval_cron_field($this->day, 1, $daysinmonth);
$validdaysofweek = $this->eval_cron_field($this->dayofweek, 0, 7);
$validmonths = $this->eval_cron_field($this->month, 1, 12);
$nextvalidyear = date('Y');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment