# 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
## Warnings
### Linux Support
Support varies by Linux distribution and installed libwebkit library and version.
### Windows Support
Requires the presence of an HTMLViewer on a window or container within the project.
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 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 | All supported view types. |
| WeekNumberLocations | SeparateColumn <br > InFirstDay | Possible display positions of the week number. |
| WeekNumberTypes | Local <br > ISO | Possible 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) | Fired when the user double clicks an existing event. |
| EventDropped | newEvent as GraffitiCalendarEvent | (None) | Raised upon completion of a BeginExternalDrag process. newEvent will contain the updated information about the DateTime in which the GraffitiCalendarEvent was placed. |
| 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. |
| Selected | startDate as DateTime <br> endDate as DateTime | (None) | Fired when a date or time range is selected. |
| UIReady | (None) | (None) | (None) |
| 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. |
| BeginExternalDrag | dragEvent as GraffitiCalendarEvent | (None) | Begins the process to drag an object from outside the calendar to create an event within the calendar. |
| Constructor | (None) | (None) | Creates a new instance of the class. |
| 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 event at the specified index in the calendar's internal array. |
| 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 index of the last item in the control's internal array. |
| LastViewButtonIndex | (None) | Integer | Returns the last view button currently added to the toolbar. |
| 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 from the toolbar. |
| RemoveEvent | theEvent as GraffitiCalendarEvent | (None) | Removes the specified event from the calendar. |
| RemoveEventAt | index as Integer | (None) | Removes the event at the specified index in the control's internal array. |
| RemoveExternalSource | URL as String | (None) | Removes an external source. |
| RemoveViewButton | index as Integer | (None) | Removes the specified view button from the toolbar. |
| RerenderEvents | (None) | (None) | Forces the display to update. |
| ScrollTo | time as DateTime | (None) | Scrolls the supplied event in to the calendar's view. |
| ScrollTo | eventObject as GraffitiCalendarEvent | (None) | Scrolls the supplied event in to the calendar's view. |
| 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 view button at the specified index. |
## 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. |
| Enabled | Boolean | (None) | (None) |
| 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. This should be, more or less, static. |
| LockUpdate | Boolean | (None) | (None) |
| RestrictEventDisplay | Boolean | (None) | Will use restrictions to hide events when True. |
| Restriction | GraffitiCalendarRestriction | (None) | Restriction to apply to display. |
| RestrictSelection | Boolean | (None) | Will restrict selection when True. |
| RestrictView | Boolean | (None) | Will restrict view when True. |
| ShowAllDaySlot | Boolean | (None) | Controls visibility of the row containing events that span entire days in applicable views. |
| ShowEventTooltips | Boolean | (None) | When True, tooltips will be automatically displayed for events on hover within the calendar. Tooltip content is the event's Description. |
| ShowNavButtons | Boolean | (None) | Shows the previous/next buttons for navigation. |
| ShowNavButtonsAtToday | Boolean | (None) | When True, navigation buttons will appear on the right to either side of the "Today" button. |
| 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) | Determines whether week numbers will be displayed. |
| ShowYearButtons | Boolean | (None) | When True, will display year navigation buttons. |
| TextSize | Integer | (None) | The default base-line text size for the display. |
| TimeFormat | String | (None) | String applied to format time values. |
| TimeMaximum | DateTime | (None) | Maximum time value. |
| TimeMinimum | DateTime | (None) | Minimum time value. |
| View | Views | (None) | The current display style. |
| ViewEnd | DateTime | (None) | Current last slot visible. |
| ViewStart | DateTime | (None) | Current first slot visible. |
| WeekNumberLocation | WeekNumberLocations | (None) | Determines where week numbers are displayed. |
| WeekNumberType | WeekNumberTypes | (None) | Determines what week number type to display. If you wish Week 1 to always be numbered "1" then use WeekNumberTypes.ISO |