# GraffitiCalendar
Class Inherits GraffitiWebUIControl
## About
GraffitiCalendar is an advanced calendar-view class. It allows for the addition of events to a calendar by using Xojo date objects, with support for a wide variety of views and allows for event dragging and resizing. Includes support for a large number of languages built-in, jQuery UI theme support, and Google Calendar imports.
Features:
*
Supports many different languages/locales
*
9 view types
*
First day of week setting
*
Custom theming with jQuery UI
*
Google Calendar import
## Preview



Previous
Next
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| False | True |
### Console
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
### iOS
| 32-Bit | 64-Bit |
| :---: | :---: |
| False | True |
### Web
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| Views | Month <br > MonthList <br > WeekAgenda <br > WeekBasic <br > WeekList <br > DayAgenda <br > DayBasic <br > DayList <br > YearList | Supported calendar views. |
| WeekNumberLocations | SeparateColumn <br > InFirstDay | Supported locations for week numbers. |
| WeekNumberTypes | Local <br > ISO | Supported types of week number. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| Closing | (None) | (None) | (None) |
| DayClick | day as DateTime <br> theView as GraffitiCalendar.Views | (None) | Fired when the user clicks on a day in the calendar. |
| Deselected | (None) | (None) | Fired when selected date is deselected. |
| EventChanged | target as GraffitiCalendarEvent | (None) | Fired when the user moves or resizes an event. |
| EventClick | target as GraffitiCalendarEvent | (None) | Fired when the user clicks on an existing event. |
| EventDoubleClick | target as GraffitiCalendarEvent | (None) | Raised when an event is double pressed. |
| EventMouseOut | target as GraffitiCalendarEvent | (None) | Fired when the user's mouse exits an existing event. |
| EventMouseOver | target as GraffitiCalendarEvent | (None) | Fired when the user's mouse enters an existing event. |
| LanguagesLoaded | (None) | (None) | Fired when the control has loaded all available languages. |
| Opening | (None) | (None) | (None) |
| Selected | startDate as DateTime <br> endDate as DateTime | (None) | Fired when a date or time range is selected. |
| ViewChanged | (None) | (None) | Fired when the user switched the view using the toolbar. |
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AddEvent | newEvent as GraffitiCalendarEvent | (None) | Adds a new event to the calendar. |
| AddExternalSource | GoogleCalendarID as String <br> GoogleCalendarKey as String <br> BGColor as Color = &c3a87ad <br> BorderColor as Color = &c3a87ad <br> TextColor as Color = &cFFFFFF | (None) | Adds a Google Calendar to the display. |
| AddViewButton | View as Views | (None) | Adds a view button to the toolbar. |
| DeselectAll | (None) | (None) | Deselects all currently selected dates. |
| DisableDay | day as DateTime | (None) | Disables the specified day. |
| EnableDay | day as DateTime | (None) | Enables the specified day. |
| EventAt | index as integer | GraffitiCalendarEvent | Returns the GraffitiCalendarEvent at the specified index in the internal array. |
| FindEvent | eventID as String | GraffitiCalendarEvent | Returns an event object by the assigned ID. |
| FindEventIndex | theID as String | Integer | Returns the integer index of an event object by the assigned ID. |
| HideDaysOfWeek | days() as Integer | (None) | Hides the specified days of the week. Values are 0-6 starting with Sunday. |
| HideDaysOfWeek | ParamArray days as Integer | (None) | Hides the specified days of the week. Values are 0-6 starting with Sunday. |
| ICSExport | Domain as String | String | Returns all events in ICS format. |
| ICSImport | theICS as String | (None) | Imports events in an ICS-formatted string. |
| LastIndex | (None) | Integer | Returns the highest index of the events in the internal array. |
| LastViewButtonIndex | (None) | Integer | Returns the last view button. |
| LoadTheme | themeURL as String | (None) | Applies a jQuery UI theme to the calendar. |
| MoveNext | (None) | (None) | Navigates to the next day/week/month in the display. |
| MoveNextYear | (None) | (None) | Navigates to the next year. |
| MovePrev | (None) | (None) | Navigates to the previous day/week/month in the display. |
| MovePrevYear | (None) | (None) | Navigates to the previous year. |
| MoveToDate | theDate as DateTime | (None) | Navigates to the defined date. |
| MoveToToday | (None) | (None) | Resets the display to display the current date. |
| RefetchEvents | (None) | (None) | Re-imports external event sources. |
| RemoveAllEvents | (None) | (None) | Removes all events from the calendar. |
| RemoveAllViewButtons | (None) | (None) | Removes all view buttons. |
| RemoveEvent | theEvent as GraffitiCalendarEvent | (None) | Removes the specified event from the calendar. |
| RemoveExternalSource | URL as String | (None) | Removes an external source. |
| RemoveViewButton | index as Integer | (None) | Removes the specified view button. |
| RerenderEvents | (None) | (None) | Forces the display to update. |
| SelectDates | StartDate as DateTime <br> EndDate as DateTime = Nil | (None) | Selects the specified date range. |
| UpdateEvent | theEvent as GraffitiCalendarEvent | (None) | Updates an event in the calendar after changing properties of the Event object. |
| ViewButton | index as Integer | Views | Returns the specified view button. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| BackgroundColor | Color | (None) | The background color of the display. |
| CustomTheme | Boolean | (None) | If True, uses the theme loaded by LoadTheme. |
| Editable | Boolean | (None) | If False, will not allow the user to move or resize events. |
| FirstDayOfWeek | Integer | (None) | First day of the week, -1 is the current locale default, 0-6 are Sunday through Saturday. |
| Language | String | (None) | The current view language. |
| Languages() | String | (None) | Array of supported languages. |
| LockUpdate | Boolean | (None) | Used to pause/resume updates for large datasets. |
| RestrictEventDisplay | Boolean | (None) | When True, will limit event rendering based on the Restriction. |
| Restriction | GraffitiCalendarRestriction | (None) | Restriction applied to the calendar. |
| RestrictSelection | Boolean | (None) | When True, will limit slot selection base on the Restriction. |
| RestrictView | Boolean | (None) | When True, will limit the view based on the Restriction. |
| ShowNavButtons | Boolean | (None) | Shows the previous/next buttons for navigation. |
| ShowNavButtonsAtToday | Boolean | (None) | When True, navigation buttons will appear on either side of the Today button in the toolbar. |
| ShowTitle | Boolean | (None) | Shows the title area which contains the current view's date range. |
| ShowTodayButton | Boolean | (None) | Shows a button allowing the user to quickly shift the view back to the current day. |
| ShowWeekNumbers | Boolean | (None) | Controls the display of week numbers. |
| ShowYearButtons | Boolean | (None) | Controls the display of the year navigation buttons in the toolbar. |
| ShowYearNavButtons | Boolean | (None) | Shows the previous/next year navigation buttons. |
| TextSize | Integer | (None) | The default base-line text size for the display. |
| TimeFormat | String | (None) | Format string applied to time values. |
| TimeMaximum | DateTime | (None) | Maximum time value. |
| TimeMinimum | DateTime | (None) | Minimum time value. |
| View | GraffitiCalendar.Views | (None) | The current display style. |
| ViewEnd | DateTime | (None) | Maximum rendered view slot DateTime. |
| ViewStart | DateTime | (None) | Minimum rendered view slow DateTime. |
| WeekNumberLocation | WeekNumberLocations | (None) | Location of week numbers. |
| WeekNumberType | WeekNumberTypes | (None) | Type of week numbers displayed. |