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
With the example of "FREQ=MONTHLY;INTERVAL=1;BYSETPOS=-1;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=26,27,28,29,30,31;COUNT=12"
you have a set of occurences falling at 26-31 of the month and only on MO,TU,WE,TH,FR.
BYSETPOS is not a rule by itself, actually it limits the rule. It means take the n-th instance from the calculated instances corresponding to the rest of the rule. So in our case it means take the last day at the end of the month of the working days.
The BYSETPOS rule part specifies a COMMA-separated list of values
that corresponds to the nth occurrence within the set of
recurrence instances specified by the rule. BYSETPOS operates on
a set of recurrence instances in one interval of the recurrence
rule. For example, in a WEEKLY rule, the interval would be one
week A set of recurrence instances starts at the beginning of the
interval defined by the FREQ rule part. 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:
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 occurrences specified by the
rule.
Repository owner locked and limited conversation to collaborators on Sep 17, 2021
Activity
boryn commentedon Sep 17, 2021
Hi @marcoczen!
With the example of
"FREQ=MONTHLY;INTERVAL=1;BYSETPOS=-1;BYDAY=MO,TU,WE,TH,FR;BYMONTHDAY=26,27,28,29,30,31;COUNT=12"you have a set of occurences falling at 26-31 of the month and only on MO,TU,WE,TH,FR.
BYSETPOS is not a rule by itself, actually it limits the rule. It means take the n-th instance from the calculated instances corresponding to the rest of the rule. So in our case it means take the last day at the end of the month of the working days.
Hope it clarifies :)
marcoczen commentedon Sep 17, 2021
Hi @boryn ,
Noted ...
-1 ? nth instance ... but its not 2 or 3 or 1 but -1 ?
Also, if i want the last of an occurence, its -1 ? Cant it be +366 or +365 ?
Also bysetpos works on byday or bymonthday ? or both ?
Sorry if i am a dumbass....
marcoczen commentedon Sep 17, 2021
Background info for the next noob ...
From https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5
The BYSETPOS rule part specifies a COMMA-separated list of values
that corresponds to the nth occurrence within the set of
recurrence instances specified by the rule. BYSETPOS operates on
a set of recurrence instances in one interval of the recurrence
rule. For example, in a WEEKLY rule, the interval would be one
week A set of recurrence instances starts at the beginning of the
interval defined by the FREQ rule part. 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: