Removed support for cron syntax #163

This commit is contained in:
Brendan Heywood
2020-03-26 01:40:06 +11:00
parent 9ed0b74112
commit afc81edfde
2 changed files with 1 additions and 18 deletions

View File

@@ -92,22 +92,8 @@ class outagelib {
$default = $config->default_time;
if ($default) {
// First try natural language parsing.
$time = strtotime($default, $time);
// Lean on the Task API to convert the cron syntax to
// the next valid outage date and time.
$parts = explode(' ', $default);
if (count($parts) == 5) {
$task = new \core\task\calendar_cron_task();
$task->set_minute($parts[0]);
$task->set_hour($parts[1]);
$task->set_day($parts[2]);
$task->set_month($parts[3]);
$task->set_day_of_week($parts[4]);
$time = $task->get_next_scheduled_time();
}
}
return $time;
}