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.

All other Modules

Discuss all other Modules here.

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

Can you do this with recurring events


Reply

5 Posts   752 Views

Avatar
otherjohn

10 August 2010 at 3:14am (Last edited: 10 August 2010 3:18am), Community Member, 125 Posts

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

10 August 2010 at 3:41am 4085 Posts

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

10 August 2010 at 3:53am Community Member, 125 Posts

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

10 August 2010 at 4:13am 4085 Posts

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

10 August 2010 at 4:14am Community Member, 125 Posts

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