From: unknown Date: Mon, 29 Sep 2014 16:36:13 +0000 (+0100) Subject: Validation - End date should be after event's start date X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6560611564cb6398faa61868b859c392d624126c;p=civicrm-core.git Validation - End date should be after event's start date --- diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index a13462a9b7..d401f096b3 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -146,11 +146,10 @@ class CRM_Core_Form_RecurringEntity { } if($values['ends'] == 2){ if ($values['repeat_absolute_date'] != "") { - $today = date("Y-m-d H:i:s"); - $today = CRM_Utils_Date::processDate($today); + $eventStartDate = CRM_Utils_Date::processDate($values['repetition_start_date']); $end = CRM_Utils_Date::processDate($values['repeat_absolute_date']); - if (($end <= $today) && ($end != 0)) { - $errors['repeat_absolute_date'] = ts('End date should be after today\'s date'); + if (($end < $eventStartDate) && ($end != 0)) { + $errors['repeat_absolute_date'] = ts('End date should be after event\'s start date'); } }else{ $errors['repeat_absolute_date'] = ts('This is a required field');