10713 Posts in 2391 Topics by 1763 members
|Go to End|
10 August 2010 at 3:14am Last edited: 10 August 2010 3:18am
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?
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.
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.
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.
10 August 2010 at 4:14am
Awesome, I will hopefully be able to figure it out and report back successful.
|Go to Top|