CRM-16563 Recurring event system sometimes suggests incorrect dates

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.2, 4.6.3, 4.6.4
    • Fix Version/s: None
    • Component/s: CiviEvent
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      I've been working with a new installation of 4.6.2 and trying out the recurring events feature. I've been very impressed with how robust it is given that this is a new feature, and I've used it to create over a thousand events on this one installation without any errors. Until I needed to set a simple event which repeated just three times on consecutive days to give four events overall. The first day was Dec 15, and I wanted it to repeat on the 16, 17 and 18.
      I set the "repeats every" option to 1 day, and the "Ends" option to 'on Dec 18'. Save the settings and the pop-up lists the following suggested events:
      15 Dec
      16th Dec
      17th Dec
      18th Dec
      19th Dec
      I have repeated this on the demo site at http://d46.demo.civicrm.org (4.6.4) with the same results. If I change the "ends on" option to Dec 17 then the last suggested date changes to Dec 18.
      I've used the "Ends on" date setting on many occasions when the "repeats every" option is set to '1 week' and have not seen this error on those occasions.
      In addition, when setting "repeats every" to 1 day I found that if you set any dates to be excluded, these were ignored and the events were created for those dates anyway, even though the excluded dates were respected on the confirmation page,.

        Attachments

        1. Safari003.jpg
          101 kB
          Graham Mitchell
        2. Safari004.jpg
          131 kB
          Graham Mitchell

          Activity

          [CRM-16563] Recurring event system sometimes suggests incorrect dates
          Jitendra Purohit added a comment -

          Hi Graham,

          I can't replicate this one. I followed the same steps given in the description on our standard demo server(4.6.4), i.e,

          • created an event .
          • On repeats tab -> Set the `Repetition Start Date` to Dec 15 2015.
          • `repeats every` option is set to 1 day and "Ends" option to 'on Dec 18 2015'.

          On Saving, the popup confirmation list shows me the correct dates from 15 to 18 Dec (I can't see the 19th date as in your case).

          In Addition, I found a different issue with the dates – Repetition start date is set to today on continuing from the confirmation popup (It should be 15 Dec which is correctly seen in the confirmation popup).

          Please comment if I'm missing any step to replicate your issue.

          Thanks.

          Graham Mitchell added a comment - - edited

          In my case I was specifically working with an event that was set up with no start time or end time but did have a start date and end date. I was wondering whether this might be the cause, because I hadn't seen any issues when I was creating timed events.
          I've got screen shots but not sure how to attach them to this comment.
          Update: I've attached 2 screenshots to the original issue, illustrating the problem using the demo site.

          Deepak Srivastava added a comment -

          Submitted PR: https://github.com/civicrm/civicrm-core/pull/5950

          Reason is: ends-on date is stored against absolute-date column of scheduled reminder table which is of type date than datetime. To make the day count as inclusion, code was adding day 1 to it.
          This being interpreted by recursion library as next-day with time of 12:00AM. Which made events with no or 12:00AM time propagate to next day satisfying the condition.

          The fix removes the increment of day 1, and adds a time of 23:59, to the ends-on date.

          Jitendra Purohit added a comment -

          PR works fine and fix the above issue.

            People

            • Assignee:
              Jitendra Purohit
              Reporter:
              Graham Mitchell

              Dates

              • Created:
                Updated:
                Resolved: