Jump to:

10930 Posts in 2613 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Can you do this with recurring events

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 736 Views
  • otherjohn
    Avatar
    Community Member
    125 Posts

    Can you do this with recurring events Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Can you do this with recurring events Link to this post

    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.

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Can you do this with recurring events Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Can you do this with recurring events Link to this post

    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.

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Can you do this with recurring events Link to this post

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

    736 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.