# Titanium.Calendar.Calendar

> An object that represents a single calendar.

- Source: https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.Calendar.Calendar
- Titanium SDK version: 12.6.1
- Kind: proxy
- Platforms: Android, iPhone, iPad, macOS
- Since: Titanium SDK Android 3.2.0, iPhone 3.1.0, iPad 3.1.0
- Extends: Titanium.Proxy
- Inheritance: Titanium.Proxy

## Properties

### hidden

- Type: Boolean
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

Indicates whether this calendar can be edited or deleted.

This property is `true` when this calendar is editable.

### id

- Type: String
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

Identifier of this calendar.

### name

- Type: String
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

Display name of this calendar.

### selected

- Type: Boolean
- Platforms: Android
- Permission: read-only

Indicates whether the calendar is selected.

Set to `true` when this calendar is selected.

See [Titanium.Calendar](https://titaniumsdk.com/docs/sdk/Titanium.Calendar.md) for examples.

### sourceIdentifier

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.1.0
- Permission: read-only

Displays the source identifier.

### sourceTitle

- Type: String
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.1.0
- Permission: read-only

Displays the source title.

### sourceType

- Type: Number
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.1.0
- Permission: read-only

Displays the source type.

Accepts: `Titanium.Calendar.SOURCE_TYPE_BIRTHDAYS`, `Titanium.Calendar.SOURCE_TYPE_CALDAV`, `Titanium.Calendar.SOURCE_TYPE_EXCHANGE`, `Titanium.Calendar.SOURCE_TYPE_LOCAL`, `Titanium.Calendar.SOURCE_TYPE_MOBILEME`, `Titanium.Calendar.SOURCE_TYPE_SUBSCRIBED`

## Methods

### createEvent

- Platforms: Android, iPhone, iPad, macOS

Creates an event in this calendar.

Parameters:

- `properties` (Dictionary<Titanium.Calendar.Event>): Properties of the event

Returns: Titanium.Calendar.Event

### createEvents

- Platforms: Android
- Since: Titanium SDK 12.6.0

Creates multiple events at once in this calendar.

Use this method to bulk-create events for faster performance.
Successful or failed results are returned at the same position as passed in the parameters list.
For failed events, it will return `null` and [Titanium.Calendar.Event](https://titaniumsdk.com/docs/sdk/Titanium.Calendar.Event.md) for successful events.

Parameters:

- `propertiesArray` (Array<Dictionary<Titanium.Calendar.Event>>): Array of the event properties

Returns: Array<Titanium.Calendar.Event>

### deleteEvents

- Platforms: Android
- Since: Titanium SDK 12.6.0

Deletes multiple events with their specified identifier(s).

Use this method to bulk-delete events for faster performance.
This method only returns the count of successfully deleted events.
If it is important for apps to know whether the event was deleted or not,
either use the [remove()](https://titaniumsdk.com/docs/sdk/Titanium.Calendar.Event.md#remove) method, or 
a single identifier that is passed as an array to this method.
If a specified identifier event does not exist, it will not be treated as a count,
so the count range can be in `0 <= count <= ids.length`.

Parameters:

- `ids` (Array<Number> | Array<String>): Array of identifiers of events.

Returns: Number - Count of successfully deleted events.

### getEventById

- Platforms: Android, iPhone, iPad, macOS

Gets the event with the specified identifier.

Parameters:

- `id` (String): Identifier of the event.

Returns: Titanium.Calendar.Event

### getEventsBetweenDates

- Platforms: Android, iPhone, iPad, macOS

Gets events that occur between two dates.

Parameters:

- `date1` (Date | String): Start date.
- `date2` (Date | String): End date.

Returns: Array<Titanium.Calendar.Event>

### getEventsById

- Platforms: Android
- Since: Titanium SDK 12.6.0

Gets multiple events with their specified identifier(s).

Use this method to bulk-fetch events for faster performance.
Only successful events are returned, so the identifier of events
should be used to compare which events were not fetched successfully.

Parameters:

- `ids` (Array<Number> | Array<String>): Array of identifiers of events.

Returns: Array<Titanium.Calendar.Event>

### getEventsInDate

- Platforms: Android, iPhone, iPad, macOS
- DEPRECATED since 7.0.0. Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.

Gets events that occur on a specified date.

Parameters:

- `year` (Number): Year of the events.
- `month` (Number): Month of the events, as a zero-based integer with January at 0 and December at 11.
- `day` (Number): Day of the month of the events.

Returns: Array<Titanium.Calendar.Event>

### getEventsInMonth

- Platforms: Android, iPhone, iPad, macOS
- DEPRECATED since 7.0.0. Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.

Gets events that occur during a specified month.

Parameters:

- `year` (Number): Year of the events.
- `month` (Number): Month of the events, as a zero-based integer with January at 0 and December at 11.

Returns: Array<Titanium.Calendar.Event>

### getEventsInYear

- Platforms: Android, iPhone, iPad, macOS
- DEPRECATED since 7.0.0. Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.

Gets all events that occur during a specified year.

Parameters:

- `year` (Number): Year of the events.

Returns: Array<Titanium.Calendar.Event>

## Inherited members

7 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `lifecycleContainer`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

