Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Events.RecurrenceDayOfWeek.NewWithDayOfWeek

Creates a object with a day of the week.

Component Version macOS Windows Linux Server iOS SDK
Events 6.2 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "Events.RecurrenceDayOfWeek.NewWithDayOfWeek"; dayOfTheWeek { ; WeekNumber } )   More

Parameters

Parameter Description Example Flags
dayOfTheWeek The day of the week. 1
WeekNumber The number of the week. 5 Optional

Result

Returns day of week reference ID or error.

Description

Creates a object with a day of the week.
EKRecurrenceDayOfWeek specifies either a simple day of the week, or the nth instance of a particular day of the week, such as the third Tuesday of every month. The week number is only valid when used with monthly or yearly recurrences, since it would be otherwise meaningless.
Valid values for dayOfTheWeek are integers 1-7, which correspond to days of the week with Sunday = 1. Valid values for weekNumber portion are (+/-)1-53, where a negative value indicates a value from the end of the range. For example, in a yearly event -1 means last week of the year. -1 in a Monthly recurrence indicates the last week of the month.
The value 0 also indicates the weekNumber is irrelevant (every Sunday, etc.).
Day-of-week weekNumber values that are out of bounds for the recurrence type will result in an exception when trying to initialize the recurrence. In particular, weekNumber must be zero when passing EKRecurrenceDayOfWeek objects to initialize a weekly recurrence.

Examples

Pick Sunday:

MBS( "Events.RecurrenceDayOfWeek.NewWithDayOfWeek"; 1)

See also

This function checks for a license.

Created 10th March 2016, last changed 14th March 2017


Events.RecurrenceDayOfWeek.DayOfTheWeek - Events.RecurrenceDayOfWeek.WeekNumber