CRM-16563 include end-date by using time 23:59 than incrementing by day 1
authordeepak-srivastava <deepak.srivastava.0303@gmail.com>
Wed, 3 Jun 2015 08:50:43 +0000 (09:50 +0100)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Wed, 3 Jun 2015 09:15:09 +0000 (10:15 +0100)
----------------------------------------
* CRM-16563: Recurring event system sometimes suggests incorrect dates
  https://issues.civicrm.org/jira/browse/CRM-16563

CRM/Core/BAO/RecurringEntity.php

index 5402d5a3a5c9727a5bdd5df0e5122d9b150ede7e..dae4dd10d3860e414f07b86abb0927d68603561c 100644 (file)
@@ -1082,8 +1082,9 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
 
       if (!empty($scheduleReminderDetails['absolute_date'])) {
         $absoluteDate = CRM_Utils_Date::setDateDefaults($scheduleReminderDetails['absolute_date']);
-        $endDate = new DateTime($absoluteDate[0] . ' ' . $absoluteDate[1]);
-        $endDate->modify('+1 day');
+        // absolute_date column of scheduled-reminder table is of type date (and not datetime)
+        // and we always want the date to be included, and therefore appending 23:59
+        $endDate = new DateTime($absoluteDate[0] . ' ' . '23:59');
         $r->until($endDate);
       }