Просмотр исходного кода

Add check for Entry Time equalling Exit Time

Alan Lam 5 лет назад
Родитель
Сommit
bae9f084c0
2 измененных файлов с 2 добавлено и 0 удалено
  1. 1 0
      controllers/practice.php
  2. 1 0
      controllers/test_tester_form.php

+ 1 - 0
controllers/practice.php

@@ -80,6 +80,7 @@ if($submit) {
 					$unix_end = $dt_end->format("U");
 
 					if($unix_start > $unix_end) $form_exception->addError(__("Entry Time must not be after Exit Time."));
+					if($unix_start === $unix_end) $form_exception->addError(__("Entry Time must not equal the Exit Time."));
 					if(!$unix_start && $unix_end && $test->dts_start) {
 						$recorded_start_unix = Util::getUnixTimeFromUTC($test->dts_start);
 						if($unix_end < $recorded_start_unix) $form_exception->addError(__("Exit Time cannot be later than the recorded Entry Time."));

+ 1 - 0
controllers/test_tester_form.php

@@ -69,6 +69,7 @@ if($submit) {
 					$unix_end = $dt_end->format("U");
 
 					if($unix_start > $unix_end) $form_exception->addError(__("Entry Time must not be after Exit Time."));
+					if($unix_start === $unix_end) $form_exception->addError(__("Entry Time must not equal the Exit Time."));
 					if(!$unix_start && $unix_end && $test->dts_start) {
 						$recorded_start_unix = Util::getUnixTimeFromUTC($test->dts_start);
 						if($unix_end < $recorded_start_unix) $form_exception->addError(__("Exit Time cannot be later than the recorded Entry Time."));