Calendar.Events
---------------

Queries events.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Calendar](component_Calendar.md) | [3.4](newinversion34.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "Calendar.Events"; StartDate; EndDate { ; calendarRef } ) 

**MBS**( **"Calendar.Events";** /\* Queries events. \*/  
**$StartDate**; /\* The start date time stamp. \*/   
**$EndDate**; /\* The end time stamp.  
If you want to get events for one day, please pass startDate with that date and time 00:00:00 and for enddate the same date with endDate 23:59:59. \*/   
**$calendarRef**) /\* Optional; A calendar identifier or name to search only this calendar.  
If no calendar is specified, we check all calendars. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| StartDate | The start date time stamp. | $startDate |  |
| EndDate | The end time stamp.   If you want to get events for one day, please pass startDate with that date and time 00:00:00 and for enddate the same date with endDate 23:59:59. | $endDate |  |
| calendarRef | A calendar identifier or name to search only this calendar.   If no calendar is specified, we check all calendars. | $calendarRef | Optional |

### Result

Returns list of event identifiers or error.

### Description

Queries events.  
If you pass calendar, only this calendar is searched. Else the specific calendar is searched.  
If you get no events, please check in system privacy preferences whether FileMaker does have permissions to access the calendars at all.  
The system limits results to around 4 years, so if you need to query bigger time spans, please use several calls.  
### Examples

Queries events:

 MBS ( "Calendar.Events"; myDatabase::StartDate ; myDatabase::EndDate )  
### See also

- [Calendar.NewEvent](CalendarNewEvent.md)

### Example Databases

- [Mac and iOS/Events/Calendar/Calendar Events](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Calendar/Calendar%20Events.shtml#1ScriptAnchor_)
- [Mac and iOS/Events/Calendar/Calendar Import](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Calendar/Calendar%20Import.shtml#1ScriptAnchor_)

### Blog Entries

- [Import Calendar Items into FileMaker](https://www.mbsplugins.de/archive/2017-11-03/Import_Calendar_Items_into_Fil/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 11st October 2019

  
[Calendar.Calendars](CalendarCalendars.md) - [Calendar.Initialize](CalendarInitialize.md)

[HTML Version](CalendarEvents.shtml)