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

Can you do this with recurring events


Go to End


5 Posts   1124 Views

Avatar
otherjohn

Community Member, 125 Posts

10 August 2010 at 3:14am

Edited: 10/08/2010 3:18am

Hi Unclecheese,
I am trying to figure out how I can possibly program the ability to do more than one recurring rule without making duplicate events, and I have an idea I want to throw out to see if you think it might work.

I want to be able to repeat like the following examples: 1st and 3rd sundays of the month, 2nd and 4th Fridays of the month, etc..
I know we can just do 1st Sunday of each month or 2nd Friday of the month. But its the second repeater that seems to be the catch.

So here is my thought:
What if in the repeating dropdown [1st, 2nd, 3rd, 4th, 5th], I add:
1st & 2nd,
1st & 3rd,
1st & 4th,
1st & 5th,
2nd & 3rd,
2nd & 4th,
2nd & 5th,
3rd & 4th,
3rd & 5th,
4th & 5th

And so when it creates those dates, it fires off the repeating creation for the 1st repeat THEN runs again for the second rule.
I think you would change the code around recursionHappensOn? (just browsing the code)

Is this possible?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 August 2010 at 3:41am

I'm hesitant to update the dropdown as you suggest. It's just kind of a patchwork fix for one specific requirement. Ultimately, I think we need checkboxes for first, second, third, fourth, and fifth, so you can specify any combination you like.

Out of curiosity, how would you do this in Google Calendar or iCal? I use those as my benchmarks.

Avatar
otherjohn

Community Member, 125 Posts

10 August 2010 at 3:53am

Is there a way I can extend the calendar to rewrite the correct functions so when the calendar gets updated I don't have to touch it's core functions?

I am not sure you can do this in iCal or google. But for those apps, cloning an event works fine because it's a localized application. Where for my need, I have these events published online and duplicating an event doesn't work as well in the big picture (SEO, Management, Usability, etc).

Also, at the same time, I don't know if this is a feature that should be default for the event calendar since I may be the only one asking for it, so I figured I could try to code it myself. So I am just looking for the best way to do this without overwriting your code.

btw,I think the checkbox idea is much better than my idea.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 August 2010 at 4:13am

Yeah, I would just overload the CalendarEvent class. That's where the recursionHappensOn() function is, and also the model that defines the recursion. You'd need to update that, and of course, the getCMSFields() function to modify the dropdown.

Avatar
otherjohn

Community Member, 125 Posts

10 August 2010 at 4:14am

Awesome, I will hopefully be able to figure it out and report back successful.
Thanks!