diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index a6dceda..57a0e49 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -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; } diff --git a/lang/en/auth_outage.php b/lang/en/auth_outage.php index ae585aa..9f27c96 100644 --- a/lang/en/auth_outage.php +++ b/lang/en/auth_outage.php @@ -81,10 +81,7 @@ $string['defaultoutagedurationdescription'] = 'Default duration (in minutes) of $string['defaultwarningduration'] = 'Warning duration'; $string['defaultwarningdurationdescription'] = 'Default warning time (in minutes) for outages.'; $string['defaulttime'] = 'Default time'; -$string['defaulttimedescription'] = 'The default time for the next outage. This is expressed in either natural language or a cron notation. eg to say that a regular outage window is any Thursday at 7pm either of these work: -
0 19 * * 4 -next Thursday 7pm-See also Cron expressions and Relative dates'; +$string['defaulttimedescription'] = 'The default time for the next outage, expressed in natural language eg "next Thursday 7pm". See PHP relative dates'; $string['defaulttitle'] = 'Title'; $string['defaulttitledescription'] = 'Default title for outages. Use {{start}} and {{stop}} placeholders as required.'; $string['defaulttitlevalue'] = 'System down from {{start}} for {{duration}}';