Validation - End date should be after event's start date
authorunknown <priyanka.karan26@gmail.com>
Mon, 29 Sep 2014 16:36:13 +0000 (17:36 +0100)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 3 Oct 2014 09:08:27 +0000 (10:08 +0100)
CRM/Core/Form/RecurringEntity.php

index a13462a9b71ad6d008bef943a8aa07282149d195..d401f096b3009ded669a4be601e9ef791c1779a1 100644 (file)
@@ -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');