From 7c63aa3245f9984e91373109cbf03ace6b80c062 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 25 Apr 2019 15:09:50 +1200 Subject: [PATCH] Fix #354 --- add_form.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/add_form.php b/add_form.php index e96bfce..5d40c25 100644 --- a/add_form.php +++ b/add_form.php @@ -336,11 +336,11 @@ class mod_attendance_add_form extends moodleform { if ($addmulti && ceil(($data['sessionenddate'] - $data['sessiondate']) / YEARSECS) > 1) { $errors['sessionenddate'] = get_string('timeahead', 'attendance'); } - - if ($data['sessiondate'] < $data['coursestartdate'] && $data['sessiondate'] != $data['previoussessiondate']) { + $sessstart = $data['sessiondate'] + $sesstarttime; + if ($sessstart < $data['coursestartdate'] && $sessstart != $data['previoussessiondate']) { $errors['sessiondate'] = get_string('priorto', 'attendance', - userdate($data['coursestartdate'], get_string('strftimedmy', 'attendance'))); - $this->_form->setConstant('previoussessiondate', $data['sessiondate']); + userdate($data['coursestartdate'], get_string('strftimedmyhm', 'attendance'))); + $this->_form->setConstant('previoussessiondate', $sessstart); } if (!empty($data['studentscanmark']) && $data['automark'] == ATTENDANCE_AUTOMARK_CLOSE) {