Table of Contents
See Also
Enumerations
Name | Values |
---|---|
Views | Month |
Agenda | |
AgendaWeek | |
AgendaDay | |
Basic | |
BasicWeek | |
BasicDay | |
List | |
ListYear | |
ListMonth | |
ListWeek | |
ListDay |
Constants
Name | Type | Value |
---|---|---|
ViewDayAgenda | Integer | 3 |
ViewDayBasic | Integer | 4 |
ViewMonth | Integer | 0 |
ViewWeekAgenda | Integer | 1 |
ViewWeekBasic | Integer | 2 |
Events
Definition | Description |
---|---|
DateDoubleClick( theDate as Date ) | Raised when the user double clicks a date/time. |
DateSelected( DateStart as Date, DateEnd as Date = nil, StartTime as Boolean = False, EndTime as Boolean = False ) | Raised when the user clicks on a day/time on the calendar. |
EventChanged( theEvent as GraffitiWebCalendarEvent ) | Fires when the user changes an event (such as by dragging). |
EventDoubleClick( theEvent as GraffitiWebCalendarEvent, atDate as Date ) | Raised when the user double-clicks an event. |
EventMouseEnter( theEvent as GraffitiWebCalendarEvent, X as Integer, Y as Integer ) | Raised when the user moves their mouse in to an event. |
EventMouseLeave( theEvent as GraffitiWebCalendarEvent ) | Raised when the use moves their mouse out of an event. |
EventSelected( theEvent as GraffitiWebCalendarEvent, atDate as Date ) | Raised when the user clicks an event. |
LanguagesLoaded( CalLanguages() as String ) | This event is raised once the calendar has completely loaded the list of available languages, and facilitates dynamic locale selection. |
ViewChanged( NewView as Integer, StartDate as Date, EndDate as Date ) | Fired when the user changes the view (IE: from Month to Week to Day). |
Methods
Definition | Description |
---|---|
AddEvent( newEvent as GraffitiWebCalendarEvent ) | Add a new event to the calendar. |
AddExternalSource( URL as String, BGColor as Color = &c3a87ad, BorderColor as Color = &c3a87ad, TextColor as Color = &cFFFFFF ) | Add an external source to the calendar, such as a Google Calendar feed. |
AddRestriction( theRestriction as GraffitiWebCalendarRestriction ) | Adds a view restriction. |
AddViewButton(View as Views) | Adds a new view button to the right-hand side of the header. |
DayTitle(Day as Date) as String | Returns the title set for the specified date. |
DayTitle(Day as Date, Title as String, Style as WebStyle = Nil) | Sets the day title with optional style for a date. |
DeselectAll() | Deselect all selected dates and events. |
EventsAtDate( theDate as Date) As GraffitiWebCalendarEvent() | Returns an array of GraffitiWebCalendarEvents that fall on the specified date, including recurring events. |
FindEvent( theID as Integer ) As GraffitiWebCalendarEvent | Used to find an event by ID, and return the event object. |
FindEventIndex( theID as Integer ) as Integer | Used to find an event by ID, and return an integer index. |
ICSExport( Domain as String ) as String | Exports all current events to ICS format. |
ICSImport( theICS as String ) | Imports ICS-formatted event data to GraffitiWebCalendar events. |
MoveNext() | Move to the next Month/Week/Day |
MoveNextYear() | Move to the next year. |
MovePrev() | Move to the previous Month/Week/Day |
MovePrevYear() | Move to the previous year. |
MoveToDate( theDate as Date ) | Bring theDate in to view. |
MoveToToday() | Move the view to show the current date. |
RefetchEvents() | Causes the calendar to refetch all events. Useful if changes are made to an external source. |
RemoveAllEvents() | Removes all events from the calendar. |
RemoveAllRestrictions() | Removes all restrictions from the calendar view. |
RemoveAllViewButtons() | Removes all view buttons. |
RemoveEvent( theEvent as GraffitiWebCalendarEvent ) | Remove the supplied event object from the calendar. |
RemoveExternalSource( URL as String ) | Remove the external source signified by URL. |
RemoveRestriction( theID as String ) | Removes a restriction from the calendar view. |
RemoveViewButton(index as Integer) | Removes the specified view button. |
RerenderEvents() | Forces the calendar to rerender all events. Useful if you notice any weirdness. |
SelectDates( StartDate as Date, EndDate as Date ) | Selects a range of dates in the view. |
UpdateEvent( theEvent as GraffitiWebCalendarEvent ) | Updates theEvent. The GraffitiWebCalendarEvent object passed should be the same one that has been modified. |
ViewButton(index as Integer) as Views | Returns the view button at the specified index. |
ViewButtonCount() as Integer | Returns the number of View buttons. |
Properties
Name | Type | Default Value | Description |
---|---|---|---|
CalendarView | Integer | 0 | The current view state. |
CustomTheme | Boolean | False | Determines whether the calendar is to use a custom theme. This can either be in the form of the WebStyle properties, or a jQuery UI theme CSS file added to the page with a WebPageSource. |
DisplayEventTime | Boolean | True | Controls the visibility of time in the event display. |
Editable | Boolean | True | Determines if events are editable in the display by, for example, dragging. |
Events() | GraffitiWebCalendarEventItem | Nil | The array of events that the calendar currently contains. |
Language | String | “en” | The short language string which determines the locale of the calendar. Currently contains: “en”, “ar-ma”, “ar-sa”, “ar”, “bg”, “ca”, “cs”, “da”, “de-at”, “de”, “el”, “en-au”, “en-gb”, “es”, “fa”, “fi”, “fr-ca”, “fr”, “hi”, “hr”, “hu”, “id”, “is”, “it”, “ja”, “ko”, “lt”, “lv”, “nl”, “pl”, “pt-br”, “pt”, “ro”, “ru”, “sk”, “sl”, “sr-cyrl”, “sr”, “sv”, “th”, “tr”, “uk”, “vi”, “zh-cn”, “zh-tw” |
RestrictView | Boolean | False | Restricts the view to the restrictions provided via AddRestriction. |
ShowDayButton | Boolean | True | Determines if the “Day” view selector is visible. |
ShowMonthButton | Boolean | True | Determines if the “Month” view selector is visible. |
ShowNavButtons | Boolean | True | Determines if the Prev/Next navigation buttons are visible. |
ShowNavButtonsAtToday | Boolean | True | When True, shows the navigation buttons on either side of the Today button. |
ShowTitle | Boolean | True | Whether the calendar shows the title (IE: October 2014). |
ShowTodayButton | Boolean | True | Determines if the Today button is displayed. |
ShowWeekButton | Boolean | True | Determines if the Week button is displayed. |
ShowYearButtons | Boolean | True | Determines if the Year navigation buttons are displayed. |
StyleDayFuture | WebStyle | Nil | WebStyle for a day following Today. |
StyleDayPast | WebStyle | Nil | WebStyle for a day the precedes today. |
StyleToday | WebStyle | Nil | WebStyle for the current day. |
StyleFridayHeader | WebStyle | Nil | WebStyle for the Friday header. |
StyleMondayHeader | WebStyle | Nil | WebStyle for the MondayHeader. |
StyleSaturdayHeader | WebStyle | Nil | WebStyle for the SaturdayHeader. |
StyleSundayHeader | WebStyle | Nil | WebStyle for the SundayHeader. |
StyleThursdayHeader | WebStyle | Nil | WebStyle for the ThursdayHeader. |
StyleToolbar | WebStyle | Nil | WebStyle for the toolbar area. |
StyleToolbarButtons | WebStyle | Nil | WebStyle for the toolbar buttons. |
StyleTuesdayHeader | WebStyle | Nil | WebStyle for the TuesdayHeader. |
StyleWednesdayHeader | WebStyle | Nil | WebStyle for the WednesdayHeader. |
TimeMinimum | Date | Nil | Restricts new event creation to time between TimeMinimum and TimeMaximum. Both must be set for effect. |
TimeMaximum | Date | Nil | Restricts new event creation to time between TimeMinimum and TimeMaximum. Both must be set for effect. |
ViewDate | Date | Nil | The starting day of the view, if set internally. Otherwise, any date may be provided to update the view. |
Examples
Custom Styling
To apply custom styles to your GraffitiCalendar instance, there are a number of Style*
properties provided. When using custom WebStyles, you should not set the CustomTheme
property to True, as this will result in missing elements such as the icons for toolbar buttons.
Custom jQuery UI Themes
Custom jQuery UI themes should be hosted by a traditional Apache/NGINX/IIS server, preferably on the same domain to avoid cross-site origin issues. Once you have uploaded your custom theme to a directory on your server, such as yourdomain.com/customjquitheme
you would then do the following in the GraffitiWebCalendar instance's Shown event:
me.LoadTheme( "//yourdomain.com/customjquitheme/jquery-ui.theme.min.css" ) me.CustomTheme = True
Using the Style properties is the recommended method for customizing the appearance of GraffitiWebCalendar. When crafted improperly, custom jQuery UI themes can have a dramatic impact on the appearance of your entire Xojo Web Application, and this feature may be deprecated with a future release.
Notes
To create a Google Calendar API key for use with GraffitiWebCalendar, please follow the instructions on this page.