Commit 1877e57d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Parse dates using the correct format from the language pack on view access page

(cherry picked from commit 7986d8da)
parent 12ff225f
......@@ -245,14 +245,14 @@ function editaccess_validate(Pieform $form, $values) {
if (empty($item['startdate'])) {
$item['startdate'] = null;
}
else if (!$item['startdate'] = strtotime($item['startdate'])) {
else if (!$item['startdate'] = strptime($item['startdate'], get_string('strftimedatetimeshort'))) {
$form->set_error('accesslist', get_string('unrecogniseddateformat', 'view'));
break;
}
if (empty($item['stopdate'])) {
$item['stopdate'] = null;
}
else if (!$item['stopdate'] = strtotime($item['stopdate'])) {
else if (!$item['stopdate'] = strptime($item['stopdate'], get_string('strftimedatetimeshort'))) {
$form->set_error('accesslist', get_string('invaliddate', 'view'));
break;
}
......
Markdown is supported
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