MonthSeriesRules::getNthDayOfWeek

Home Forums Calendar Products Events Calendar PRO MonthSeriesRules::getNthDayOfWeek

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #46693
    gregwiley
    Participant

    Could someone explain the algorithm of this function please? I’m having a hard time figuring it out and I suspect it holds the key to why I can’t add an option to provide a recurring fifth week day of month option.

    #46740
    Jonah
    Participant

    Hi gregwiley,

    What exactly are you looking to accomplish?

    #46754
    gregwiley
    Participant

    Hi Jonah,

    I am responsible for a church website (http://stlukeswatford.org/) and we have different services depending on which Sunday of the month we’re on and this includes the 5th Sunday of a month. At the moment The Events Calendar PRO does not support the fifth day of a month. If I use the Last Sunday I end up with two entries when there are only 4 Sundays in a month which is undesirable.

    I searched the forums and the response to what looked the same feature request was that it may be in the works and that was about 7 months ago. Having wrote some PHP code 10 years ago to solve this same problem I thought about having a go at fixing it myself, hence the question.

    Cheers, Greg.

    #46827
    Jonah
    Participant

    Hi Greg,

    Using the Last Sunday of every month seems to work ok for me. Here are my settings for the event: http://cl.ly/image/0z3Q1408430V – Have you tried that? I wonder if there’s some other conflict to prevent it from working for you.

    Thanks,
    Jonah

    #46873
    gregwiley
    Participant

    Hi Jonah,

    Thanks for the response. Yes, those settings will work but if I also add a recurring event for the fourth Sunday in a month then where a month only has four Sundays I will get two events which is not what I want.

    Cheers, Greg.

    #46938
    Jonah
    Participant

    Hi Greg,

    I’m still not understanding. Can you provide a more specific example of the events you are creating so I can replicate this on my end?

    Thanks,
    Jonah

    #46958
    gregwiley
    Participant

    Okay, sorry for not explaining this very clearly.

    Our church has a pattern of services over each month. Let’s say we have All-Age Worship on the 4th Sunday of every month, so I configure an event as such:

    https://www.evernote.com/shard/s5/sh/14446db8-b592-4078-a984-91901c5d7369/23c7dbc930cd082a7e3bf6a2552cfad9

    Every 5th Sunday of the month, when it occurs, we have Holy Communion. The way you are suggesting to configure this is to use the Last Sunday custom monthly recurrence as follows:

    https://www.evernote.com/shard/s5/sh/5bb2f9e2-0e5f-41a9-bab3-cdfc3c2f818a/3f36378ced9cfaab652457f146ef7ae1

    What happens in this case for April 28th is that I will get both the All-Age Worship since the 28th is the 4th Sunday in April and I will get the Holy Communion because April 28th is also the last Sunday in April. This is not what I want.

    Where it does work is for those months, such as June 2013, where there are 5 Sundays in the month. In that case I will get the All-Age Worship on June 23rd (the 4th Sunday) and Holy Communion on June 30th (the last Sunday).

    https://www.evernote.com/shard/s5/sh/5bb2f9e2-0e5f-41a9-bab3-cdfc3c2f818a/3f36378ced9cfaab652457f146ef7ae1

    This is why being able to specify (for a Church for example) a fifth Sunday event is important.

    I hope this explains things more clearly.

    Cheers, Greg.

    #46964
    Jonah
    Participant

    Hi Greg,

    I can’t see the event settings in the screenshots you shared. Can you please take screenshots again?

    Thanks,
    Jonah

    #46969
    gregwiley
    Participant
    #47191
    Jonah
    Participant

    Hi Greg,

    Ok, I just created some test events with the same data and it seems to be working ok for me but it sounds like it’s not working the way you need it to in your case. Basically, you are wanting a “fifth” option to repeat an event only on months where there is a fifth sunday correct?

    #47208
    gregwiley
    Participant

    Hi Jonah,

    Thanks for taking the time to look into this.

    Your synopsis of the problem is correct.

    When you say it seems to be working ok for you with your test events, what do you mean? Can you get an event to only recur on a fifth Sunday (or any other week day for that matter)?

    Cheers, Greg.

    #47254
    Jonah
    Participant

    Hi Greg,

    What I meant by it seems to be working ok for me is, it seems to be working the way I would expect it to. That is, the last sunday and fourth sunday options work fine, but I see how a fifth sunday only option would be helpful. This is something I will need to create a ticket for, to have a developer take a look at and either explain the MonthSeriesRules::getNthDayOfWeek function like you’ve requested, or flag this as a possible feature for an upcoming version. I’ll do that now and let you know what I hear back.

    Thanks for your patience and explanation thus far.

    – Jonah

    #47267
    gregwiley
    Participant

    Hi Jonah,

    Yes I agree the 4th and last Sunday options work exactly as I would expect. And yes, a fifth option would definitely be helpful.

    I’d prefer the latter approach if the upcoming version is not too far ahead in the future, if it’s further out than, say 6 months, then it might be good to get an understanding of the code to see if I can contribute but I already have a full-time job so it’s likely to take me far longer than one of your own developers.

    Cheers, Greg.

    #47365
    Jonah
    Participant

    Hi Greg,

    After discussing this with the team, we’ve decided that there isn’t enough interest in a fifth day option to warrant the development time needed to introduce this as a new recurrence option. For now it’s suggested that you just create these events as one off’s since there are only so many months with a fifth Sunday in any year.

    We are looking for ways to incorporate more random/custom recurrence patterns in the future, but have no solid plans as to when this might make it in to the plugin.

    Sorry I don’t have more to offer here. Does this answer suffice?

    #47389
    gregwiley
    Participant

    Hi Jonah,

    This is disappointing to say the least. Whether the answer suffices or not is irrelevant, you’ve made a decision based on your priorities. Thanks for giving it consideration.

    Can I ask for an explanation into the algorithm for MonthSeriesRules::getNthDayOfWeek as I originally asked then please?

    Cheers, Greg.

Viewing 15 posts - 1 through 15 (of 21 total)
  • The topic ‘MonthSeriesRules::getNthDayOfWeek’ is closed to new replies.