Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar Recurrence confusion


Go to End


2 Posts   1552 Views

Avatar
sekjal

Community Member, 7 Posts

23 May 2013 at 7:27am

Edited: 23/05/2013 7:28am

I've been working with the Event Calendar module as a means to enumerate my library's locations' open hours, and have had some difficulties with recurrence.

The data model is thus:

CalendarDateTime has a start date, end date, start time and end time (as well as they "all day" marker).

CalendarEvent has multiple CalendarDateTimes, which can be used to enumerate specific instances of this event occurring without a predictable pattern. Each one you specify will show up in the appropriate calendar view so long as you don't turn on Recurrence. Each entry will have the following details:


  • * Starts on: CalendarDateTime->start_date + CalendarDateTime->start_time
    * Ends on: CalendarDateTime->end_date + CalendarDateTime->end_time

CalendarEvent also has Recurrence, which can be toggled on, then set to daily, weekly or monthly, with some interval between. When Recurrence is set, only the first CalendarDateTime is consulted, and the recurrence continues until the day before that CalendarDateTime->end_date. So the entries look like this:


  • * Starts on: CalendarDateTime->start_date +CalendarDateTime->start_time
    * Ends on: CalendarDateTime->start_date + CalendarDateTime->end_time

Notice the differences: without recurrence, we can have event entries that span multiple days, while with recurrence, single-day events are created between the two dates specified in the first CalendarDateTime. This different usage of fields depending on whether recurrence is enabled or not seems potentially problematic.

I think there are two possible solutions to this confusion:

1. Attach Recurrence to the CalendarDateTime, not the CalendarEvent. This would allow for a whole new level of grouping recurring events: if you had weekly recurring events Sunday - Saturday, you could define all 7 days worth of recurrences on one event. You could also mix in non-recurring instances of the CalendarEvent if needed.

2. Keep Recurrence attached to CalendarEvent, but apply the pattern to all the CalendarDateTimes. This would be simpler as the data model would need to change less, but there would be overall flexibility in terms of pattern.

In either case, I think we need to either use include a RecurUntilDate and/or RecurXTimes that's separate from the end_date, so that multiple day events can recur. I think it may also be clearer to include that date in the recurrence, instead of stopping the day before (simple matter of changing "<=" to "<").

I'd very much like to hear others' opinions on the matter. What would work best for your use cases?

Avatar
cmc

Community Member, 33 Posts

9 January 2015 at 5:20am

Did you ever find a solution for this problem with recursion in the Event Calendar module?