Commit 91300f6d authored by Evan Goldenberg's avatar Evan Goldenberg
Browse files

give access start/stop dates a sane default (null)



If unspecified, view access start/stop dates defaulted
to 1900-01-01. They now default to null, making the
access granted indefinitely.
Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
parent 9cac2dd7
......@@ -346,10 +346,10 @@ function editaccess_submit(Pieform $form, $values) {
if ($values['accesslist']) {
$dateformat = get_string('strftimedatetimeshort');
foreach ($values['accesslist'] as &$item) {
if (isset($item['startdate'])) {
if ($item['startdate']) {
$item['startdate'] = ptimetotime(strptime($item['startdate'], $dateformat));
}
if (isset($item['stopdate'])) {
if ($item['stopdate']) {
$item['stopdate'] = ptimetotime(strptime($item['stopdate'], $dateformat));
}
}
......
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