Home › Forums › Calendar Products › Events Calendar PRO › MonthSeriesRules::getNthDayOfWeek
- This topic has 20 replies, 3 voices, and was last updated 12 years, 5 months ago by
Neill.
-
AuthorPosts
-
April 23, 2013 at 3:50 pm #46693
gregwiley
ParticipantCould 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.
April 24, 2013 at 9:13 am #46740Jonah
ParticipantHi gregwiley,
What exactly are you looking to accomplish?
April 24, 2013 at 9:53 am #46754gregwiley
ParticipantHi 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.
April 25, 2013 at 9:30 am #46827Jonah
ParticipantHi 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,
JonahApril 25, 2013 at 2:19 pm #46873gregwiley
ParticipantHi 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.
April 26, 2013 at 9:37 am #46938Jonah
ParticipantHi 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,
JonahApril 26, 2013 at 12:38 pm #46958gregwiley
ParticipantOkay, 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:
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:
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).
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.
April 26, 2013 at 1:17 pm #46964Jonah
ParticipantHi Greg,
I can’t see the event settings in the screenshots you shared. Can you please take screenshots again?
Thanks,
JonahApril 26, 2013 at 1:52 pm #46969gregwiley
ParticipantSorry about that, try this link:
Cheers, Greg.
April 29, 2013 at 2:04 pm #47191Jonah
ParticipantHi 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?
April 29, 2013 at 3:06 pm #47208gregwiley
ParticipantHi 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.
April 30, 2013 at 10:04 am #47254Jonah
ParticipantHi 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
April 30, 2013 at 11:02 am #47267gregwiley
ParticipantHi 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.
May 1, 2013 at 9:06 am #47365Jonah
ParticipantHi 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?
May 1, 2013 at 1:12 pm #47389gregwiley
ParticipantHi 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.
-
AuthorPosts
- The topic ‘MonthSeriesRules::getNthDayOfWeek’ is closed to new replies.
