I'm using the date module for an event calendar and some of the events we schedule repeat, but they do not repeat on a regular interval. For instance, one event occurs three times on June 6, June 27, and July 25. There is no RRULE that adequately represents that sequence of repeats without having to create a large set of exceptions.
It's possible to create an arbitrary interval and then add additions to it or create a less arbitrary interval (every Wednesday until July 27) with a long list of exceptions, but it's not possible in the current module to just say, "Repeat on these three dates". Right now the Date module is rolling up RDATE into the RRULE variable and there is no way to add an RDATE without also adding an RRULE. So when I use either of the two above options for this event, I get a really unfriendly translation of the RRULE showing up on my event page.
"Beginning on June 6 occurs every Wednesday through July 25, 2012, except June 13, June 20, July 4, July 11 and July 18, 2012"
or
"Beginning on June 6 occurs every day through June 6, 2012 and also on June 27 and July 25."
Those options are ugly but they at least work. I have another event we're scheduling that doesn't really follow any pattern at all (not even the same weekday).
The iCalendar standard allows the definition of an event with an RDATE and no RRULE, but the Date module does not appear to support that (if I'm wrong, and it does, please point it out to me). I've already spent a lot of time writing a new version of date_repeat_rrule_description() to clean up the formatting of the human-readable rrule (which is why the above strings may look unfamiliar. After June 6 the "Beginning on June 6" part is no longer prepended to the string and it just starts with "Occurs..."). The way RDATE is currently implemented is so tightly integrated with the RRULE (in forms, rule parsing, date generation, etc.) that it's a pretty large undertaking to accommodate arbitrary repeating events.
What I'd like to be able to do is create a list of additional dates without selecting a repeat frequency and get an output result that looks something like, "Occurs June 6, 2012, June 27, 2012 and July 25, 2012."
Comment | File | Size | Author |
---|---|---|---|
#2 | date_repeat_rdate_only_support.patch | 7.23 KB | gotheric |
Comments
Comment #1
gotheric CreditAttribution: gotheric commentedSame problem for me...
Comment #2
gotheric CreditAttribution: gotheric commentedI made a patch to support this.
In date editing it adds a new option to frequency dropdown: "None (only included dates)". If the user select this, frequency options and exclusions are hidden, and only "Include dates" is shown.
I commented all codes changes with "RDATE ONLY SUPPORT" text, to identify them better. Changes are quite simple.
An improvement could be to enable this code only if a global (or field) parameter is set.
I tested this code only on simple node editing and viewing and it works well, but maybe there are some different situations where it could have problems, don't know.
The patch is based on latest stable version (7.x-2.6)
Comment #4
mcrittenden CreditAttribution: mcrittenden commentedHere it is re-rolled for the latest 7.x-2.x with a couple small enhancements (such as auto-checking "Add addition" and hiding that checkbox since we know we want it to be checked if we chose to use arbitrary dates).
Screenshot: https://www.dropbox.com/s/s8hdkluc8eg9eey/Screenshot%202014-12-19%2001.2...
Comment #5
mcrittenden CreditAttribution: mcrittenden commentedComment #7
mcrittenden CreditAttribution: mcrittenden commentedComment #8
mcrittenden CreditAttribution: mcrittenden commentedAnd re-rolled again for version 2.8 (since that's the version I actually need in my make file at the moment).
Leaving ticket on version 2.x-dev since that's the patch that testbot needs to test (#4).
Comment #10
vijaycs85Thanks for your work. here are some review comments:
this condition never met and we won't have 'DAILY' never ever!
can we add a comment saying why $additions necessary here?
Not sure, it would work for all cases - Assuming end date == start date, if no 'show repeat settings'?
Comment #11
mglamanThis breaks "Include Dates" unless choosing "NONE". Needs to be removed so existing functionality works as expected.
Comment #12
mglamanIt does catch
Not sure if we need to add a comment? It's just that additions can now be added without a specific repeat pattern.
Comment #13
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 4 year old patch in #12 does not apply to the latest 7.x-2.x-dev and may be too old to reroll, but I went ahead and tagged the issue accordingly.