You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BYSETPOS rule part specifies a COMMA character (US-ASCII decimal
44) separated list of values which corresponds to the nth occurrence
within the set of events specified by the rule. Valid values are 1 to
366 or -366 to -1. It MUST only be used in conjunction with another
BYxxx rule part. For example "the last work day of the month" could
be represented as:
RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1
Each BYSETPOS value can include a positive (+n) or negative (-n)
integer. If present, this indicates the nth occurrence of the
specific occurrence within the set of events specified by the rule.
I don't think IceCube supports this right now. It would allow creating rules like the above "last work day of the month". Some ways to emulate this particular case are (as recurrence rules for Sidetiq jobs):
monthly.day_of_month(-1, -2, -3) and when ran, checking today's weekday
same, but excluding daily.day(:saturday, :sunday). Not much better, can still occur more then once a month, when none of the last three days fall on a weekend.
Calling that hypothetical new rule indexed for now, one could write monthly.day(:monday, :tuesday, :wednesday, :thursday, :friday).indexed(-1). That rule would first evaluate to all weekdays in a month, and then restricted to the last one, whichever weekday that would be.
One of our projects uses ice_cube. Because BYSETPOS is not implemented, when expanding repeating events that uses it, extra instances get created. In @k3rni's example, an instance will be created for every single weekday of the month, rather than only the last weekday of the month.
In many cases it's possible to emulate this with multiple rules that "mask" the available occurrences. This might make more sense though, I'll leave it open for consideration, but I'm not sure when I can get to it.
Hi! There are two PRs outstanding for quite some time to add this functionality. My team would really like to see this added and released. How can we help?
Reacted by Dan Dimerman, Yuri Sidorov and Gary Passero
Activity
va7map commentedon May 22, 2015
One of our projects uses ice_cube. Because
BYSETPOSis not implemented, when expanding repeating events that uses it, extra instances get created. In @k3rni's example, an instance will be created for every single weekday of the month, rather than only the last weekday of the month.Is this still on the to-do list?
avit commentedon Jan 31, 2016
In many cases it's possible to emulate this with multiple rules that "mask" the available occurrences. This might make more sense though, I'll leave it open for consideration, but I'm not sure when I can get to it.
davidstosik commentedon Jan 4, 2019
See #349 and #449.
k3rni commentedon Jan 4, 2019
Excellent! Let's close this one once #449 lands.
regentgal commentedon Feb 7, 2019
Hi! There are two PRs outstanding for quite some time to add this functionality. My team would really like to see this added and released. How can we help?
davidstosik commentedon Feb 8, 2019
@regentgal Sorry we made a mess with PRs...
Here's more recent history: #468
And a more recent PR, that is only in my fork at the moment: davidstosik#1
I'd appreciate your review and input regarding the extra specs I added.
gap777 commentedon Sep 20, 2024
We would greatly benefit from having this capability shipped... considering that PRs are opened, can we get those included?