Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

Events.RecurrenceRule.NewWithFrequency

Creates a new recurrence rule.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Events 6.2 Yes No Yes, macOS only No No

MBS( "Events.RecurrenceRule.NewWithFrequency"; Frequency; Interval; EKRecurrenceEnd { ; daysOfTheWeek; daysOfTheMonth; monthsOfTheYear; weeksOfTheYear; daysOfTheYear; setPositions } )

Parameters

Parameter Description Example value
Frequency The frequency.
Can be Yearly, Monthly, Daily or Weekly.
"Weekly"
Interval The interval to use.
Must be > 0
1
EKRecurrenceEnd The reference to the recurrence end.
Can be empty.
$RecurrenceEnd
daysOfTheWeek Optional
The days of the week list.
An list of EKRecurrenceDayOfWeek object identifiers. Valid for all recurrence types except daily. Ignored otherwise. Corresponds to the BYDAY value in the iCalendar specification.
Version 7.1 accepts here also week days, not just RecurrenceDayOfWeek IDs returned from Events.RecurrenceDayOfWeek.NewWithDayOfWeek.
daysOfTheMonth Optional
The days of the month.
An list of numbers ([+/-] 1 to 31). Negative numbers infer counting from the end of the month. For example, -1 means the last day of the month. Valid only for monthly recurrences. Ignored otherwise. Corresponds to the BYMONTHDAY value in the iCalendar specification.
monthsOfTheYear Optional
The list of months in the year.
An list of numbers (1 to 12). Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYMONTH value in the iCalendar specification.
weeksOfTheYear Optional
The list of weeks in the year.
An list of numbers ([+/1] 1 to 53). Negative numbers infer counting from the end of the year. For example, -1 means the last week of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYWEEKNO value in the iCalendar specification.
daysOfTheYear Optional
The days of the year.
An list of numbers ([+/1] 1 to 366). Negative numbers infer counting from the end of the year. For example, -1 means the last day of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYYEARDAY value in the iCalendar specification.
setPositions Optional
The list of set positions.
An list of numbers ([+/1] 1 to 366). Used at the end of recurrence computation to filter the list to the positions specified. Negative numbers indicate starting at the end, i.e. -1 indicates taking the last result of the set. Valid when daysOfTheWeek, daysOfTheMonth, monthsOfTheYear, weeksOfTheYear, or daysOfTheYear is passed. Ignored otherwise. Corresponds to the BYSETPOS value in the iCalendar specification.

Result

Returns OK or error.

Description

Creates a new recurrence rule.
This can be used to build any kind of recurrence rule. But be aware that certain combinations make no sense and will be ignored. For example, if you pass daysOfTheWeek for a daily recurrence, they will be ignored.

Examples

Create rule to repeat each year:

MBS( "Events.RecurrenceRule.NewWithFrequency"; "Yearly";"1" )

Create rule to repeat each week:

MBS( "Events.RecurrenceRule.NewWithFrequency"; "Weekly";"1"; ""; MBS( "Events.RecurrenceDayOfWeek.NewWithDayOfWeek"; 1) )

Create event in summer only:

MBS( "Events.RecurrenceRule.NewWithFrequency";
"Monthly"; // by mont
"1"; // every
""; // no end date
"";
"";
"4¶5¶6¶7¶8¶9¶10" ) // only this months

Every week Tuesday and Wednesday:

MBS( "Events.RecurrenceRule.NewWithFrequency"; "Weekly";"1"; ""; "3¶4" )

See also


Events.RecurrenceRule.MonthsOfTheYear   -   Events.RecurrenceRule.SetPositions

Feedback: Report problem or ask question.




Links
MBS Xojo blog