Help:Recurring events

A recurring event is any event that occurs more than once, according to a pre-defined rule: examples are weekly meetings, anniversaries and birthdays as well as events that span across multiple days or other units of time, such as SMWCon.

In Semantic MediaWiki, the dates for a recurring event are defined using the   parser function, which is placed on the page that represents the event. All property-value pairs that are created using this function are assigned to a special subobject. This means that the functionality described for subobjects applies to this special form of subobject too. This function additionally takes the following arguments, in any order:

General

 * If no end date is set, a fixed number of dates is simply saved. This number is defined by and adaptable with, which has a default value of " ".
 * There is also a maximum number of dates that can be saved using this function, regardless of the start and end date specified. This number is set by and adaptable with, which has a default value of " ".
 * If monthly recurring events for the dates 29th to 31st are created and the resulting months for the recurring events do not have such a date like, e.g. February for the 29th (in leap years), 30th and 31st or April for the 31st when the last date of the month will be used, e.g. 28th or 29th (in leap years) for February and 30th for April, etc. This was however not working until it was fixed with .CiteRef::gh:smw:3619
 * Dates or dates and times must either be set in English, the content language of the wiki or using the ISO date and time format.

Using dates with times
  will set a date only if no times are specified. You can however specify times in the recurring event as well. Two important items to note:
 * Exclude parameters must also specify the time. When   evaluates it will compare the excluded times array to the calculated recurrences, and is specific to the time. If you specify a start value with a time of 7:00 pm, the exclude must also reference this. If you are working with forms it is convenient to request the time in a separate field and then automatically add it to the start as well as exclude parameters for the user. You may also consider adding it to the include parameters.
 * The end parameter will also honor a time value, and the recurrences will end at that time, instead of at midnight of the date specified.
 * Internationalization of dates is incomplete, i.e. "BC", "AD", "PM", "AM" are fixed for all languages.
 * If no time is set, e.g. "January 17, 2019" then "January 17, 2019 00:00" is assumed, i.e. internally the default time is "00:00".CiteRef::gh:smw:3619:455249224

Event series
The following call would create subobjects with an Event property linking to the current page, and set the Has date property for each subobject to Mondays at 7:00 pm between January 4, 2010 and June 8, 2011, with the exception of March 15, 2010 and March 22, 2010, both of which are replaced by the following Tuesday at different times:
 * Create recurring event

The following query would display the recurring events in a calendar using on the same page where you created the recurring events.
 * Query recurring event

Birthday series
The following call creates subobjects with a Birthday property linking to the current page, and a Has birthday property for all birthdays of a person, starting with his or her date of birth; it is done by picking up the date entered on a page for the defined "Property:Has date of birth":
 * Create recurring event

If such a call were placed in a template, and the date of birth were entered as a template field, the code could be made even simpler:

The following query would display the recurring events in an ordered list using on the same page where you created the recurring events.
 * Query recurring event

More examples

 * Demonstration of recurring events - Shows live examples for recurring events on this very wiki
 * Demonstration of recurring events - Shows a live example for recurring events on 