Skip to main content

Calendar

Calendar light mode

The Calendar component is an implementation of FullCalendar (version 5) as a Perspective component. It supports multiple calendar views, event display and interaction, drag-and-drop scheduling, and built-in popups for creating and editing events.

Two optional built-in popups are available but disabled by default. The Event Popup appears when an event is clicked and can optionally allow editing. The Create Event Popup appears when a date or time block is clicked. Neither popup modifies the calendar directly — all changes are surfaced through component events for handling in scripts.

The Calendar component works alongside the External Event Box component to support drag-and-drop scheduling from an external list of events onto the calendar.

Properties

NameDescriptionProperty Type
editableAllows events to be dragged to new times and resized.boolean
selectableAllows selecting a single date or a range of dates.boolean
selectedDateWhen selectable is true and a selection is made, these readonly properties reflect the current selection.object
defaultViewThe initial calendar view displayed when the component loads.string
currentViewThe currently displayed view. Writing to this property will change the view. If an invalid view name is written, the component will error. Valid options are: dayGridMonth, dayGridWeek, dayGridDay, timeGridWeek, timeGridDay, listMonth, listWeek, listDay.string
eventsAn array of event objects to display on the calendar. See Event Object Properties below.array

Event Object Properties

Each item in the events array supports the following properties. Only start is required.

NameDescriptionProperty Type
titleThe text displayed on the event.string
startRequired. When the event starts, as a parseable date/time string. If no end is defined, the event defaults to all-day on the start date. If start includes a time and end is omitted, the event duration defaults to one hour.string
endWhen the event ends. This value is exclusive — an all-day event ending on 2020-09-03 spans through 2020-09-02.string
durationThe duration of the event as an alternative to end, in the format HH:mm.string
allDayWhen true, the event ignores any time portion of start and end.boolean
borderColorThe color of the event's border.string
backgroundColorThe background color of the event box. Also used for dots in list view.string
textColorThe color of the event's text.string
idAn identifier for the event. Defaults to an empty string if not provided.string
rruleA recurrence rule for repeating events. See the FullCalendar rrule documentation.string

Event Pop Properties

NameDescriptionProperty Type
useEventPopWhether the built-in popup for showing event details will appear when an event is clicked.boolean
canEditEventOnPopWhether the edit button appears on the built-in event popup.boolean
canExportEventOnPopWhether the event can be exported as an iCal object from the popup.boolean
useCreateEventPopWhether the built-in popup for creating events appears when a date or time block is clicked.boolean

Event Display Properties

NameDescriptionProperty Type
eventDisplayTypeControls the rendering style of events. Options: auto (solid block for all-day/multi-day, dot for timed events in daygrid), block (always solid block in daygrid), list-item (always dot in daygrid), background (highlights background), inverse-background (highlights inverse background), none (not rendered).string
colorThe default background and border color for events.string
backgroundColorThe default background color for events. Overrides color.string
borderColorThe default border color for events.string
fontControls the color, weight, size, and family of the event text.object
displayEventTimeWhether to show the start time on timed (non-all-day) events.boolean
nextDayThresholdThe minimum time that must pass into a day for a spanning event to be rendered on that day in daygrid view. Format: HH:mm:ss.string
eventOrderDetermines display order when events occupy the same space. Uses event property names; prefix with - for descending order.string
slotEventOverlapWhether timed events in TimeGrid view visually overlap.boolean

Current Calendar Date Properties

NameDescriptionProperty Type
dateAn ISO 8601 string (YYYY-MM-DD) of the current displayed date. Writable when dateIsReadOnly is false.string
dateIsReadOnlyWhen false, writing to date changes the displayed date.boolean
weekThe ISO week number of the year (readonly).number
displayDateStartThe first visible date on the display. In month view this may not be the first of the month (readonly).string
displayDateEndThe last visible date on the display. This value is exclusive (readonly).string
currentDateStartThe first date of the range the view represents (readonly).string
currentDateEndThe last date of the range the view represents. This value is exclusive (readonly).string
titleThe title string currently generated by the calendar (readonly).string

Date and Time Display Properties

NameDescriptionProperty Type
firstDayThe first day of the week in day grid views. 0 = Sunday.number
minTimeThe earliest time displayed in time grid views.string
maxTimeThe latest time displayed in time grid views.string
navLinksWhether to make parts of the calendar (e.g., date numbers) into links that navigate to related views.boolean
weekNumbersWhether to display week numbers when possible.boolean
useISOWeekCalcWhether to use ISO week numbers rather than localized week numbers.boolean
weekLabelThe label displayed before the week number.string
nowIndicatorWhether to show a red line indicating the current time on time grid views.boolean
todayColorThe highlight color for the current date.string
slotDurationThe duration of each time slot in time grid views.string
expandRowsWhether rows expand to fill the full height of the view when they don't naturally fill it.boolean
snapDurationThe time interval at which a dragged event snaps to the time axis.string
slotLabelFormatThe format of the time labels in time grid views, as a Date Format object. See FullCalendar date formatting.object
allDayTextThe text shown on the all-day slot in time grid views.string
weekendsWhether to display weekends on the calendar.boolean
hiddenDaysAn array of integers representing days to hide. Days are indexed from 0 (Sunday) to 6 (Saturday).array
businessHoursHighlights business hours on the calendar. Can be false to disable, or an object/array of objects with daysOfWeek, startTime, and endTime. Example: {"daysOfWeek": [1,2,3,4,5], "startTime": "09:00", "endTime": "17:00"}.object or boolean
timeZoneThe time zone of the calendar. Options: local (browser time zone), gateway (pulled from the Perspective session), custom (uses local but allows a custom now), or a time zone identifier string such as America/New_York.string
nowWhen timeZone is set to custom, sets the current time as an ISO formatted date string.string

Toolbar Properties

NameDescriptionProperty Type
headerConfigures the header toolbar with left, center, and right string properties. Each is a comma-separated list of toolbar elements. Set to false to remove the header entirely. Available elements: title, prev, next, prevYear, nextYear, today, or any valid view name (e.g., dayGridMonth). Spaces between commas add gaps between buttons.object or boolean
footerSame structure as header. Configures the footer toolbar. Set to false to remove.object or boolean
titleFontControls the font color, size, weight, and family of the toolbar title.object
titleSeparatorThe separator string used in the title when a date range is shown.string
buttonsControls button styling for primary, hover, and active states.object
buttonTextOverrides the default display text for toolbar buttons.object

Popover Properties

NameDescriptionProperty Type
dayMaxEventsIn dayGrid views, the maximum number of events to show per day before a "+more" link appears. Set to true to limit based on cell height.number or boolean
dayPopoverFormatThe format of the date displayed in the "+more" popover, as a Date Format object.object
moreLinkContentThe content of the "+more" link. Accepts a string or an HTML object like { html: '<i>text</i>' }.string or object
moreLinkClickThe action taken when the "+more" link is clicked. Options: popover, week, day, or any valid view name.string

View Properties

NameDescriptionProperty Type
day.columnHeaderFormatDate Format object for column headers in day views.object
day.titleFormatDate Format object for the view title in day views.object
week.columnHeaderFormatDate Format object for column headers in week views.object
week.titleFormatDate Format object for the view title in week views.object
month.columnHeaderFormatDate Format object for column headers in month views.object
month.titleFormatDate Format object for the view title in month views.object
month.fixedWeekCountWhen true, every month view shows the same number of weeks regardless of how many days the month has.boolean
month.showNonCurrentDatesWhen true, displays dates from the previous and next months that can be shown.boolean
dayGrid.showColumnHeaderWhether to show the column header in day grid views.boolean
dayGrid.eventTimeFormatDate Format object for the event time display in day grid views.object
timeGrid.showColumnHeaderWhether to show the column header in time grid views.boolean
timeGrid.eventTimeFormatDate Format object for the event time display in time grid views.object
timeGrid.showAllDaySlotWhether to show the all-day slot in time grid views.boolean
list.noEventsMessageMessage displayed when there are no events in list views.string
list.listDayFormatDate Format object for the day displayed on the left side of list view day headers. Set to false to hide.object or boolean
list.listDaySideFormatDate Format object for the day displayed on the right side of list view day headers. Set to false to hide.object or boolean

Theme Properties

NameDescriptionProperty Type
theme.classesA string or array of CSS class names to apply to the calendar for custom theming. Unlike Perspective's style.classes property, the full class name including any prefix must be provided. For example, if your style class is defined as .psc-toolbar, you must enter psc-toolbar — the prefix is not implied automatically.string or array

Locale Settings

NameDescriptionProperty Type
localeA language code that changes the calendar's header/footer titles, grid headers, and list headers to the selected language and date format. See the supported locales list.string
dirText direction. Set to ltr or rtl to support right-to-left languages such as Arabic and Hebrew.string

Component Events

onDateClick

Triggered when a date or time block is clicked on the calendar.

PropertyTypeDescription
event.dateobjectA date object containing the date and time of the block clicked.
event.dateStrstringAn ISO 8601 formatted string representing the block clicked.
event.altKeybooleanWhether the Alt key was held when the event fired.
event.shiftKeybooleanWhether the Shift key was held when the event fired.

onEventClick

Triggered when an event on the calendar is clicked. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.idintThe id of the event. Returns None if not supplied.
event.titlestringThe title of the event.
event.startstringThe start of the event.
event.endstringThe end of the event. Returns None for single-day all-day events.
event.allDayboolWhether the event spans full days.
event.altKeybooleanWhether the Alt key was held when the event fired.
event.shiftKeybooleanWhether the Shift key was held when the event fired.

onEventDropped

Triggered when an event is moved by dragging. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.idstringThe id of the event. Returns an empty string if not supplied.
event.startDatestringThe new start date of the event.
event.startTimestringThe new start time as HH:mm:ss.
event.endDatestringThe new end date of the event. Returns None for single-day all-day events.
event.endTimestringThe new end time as HH:mm:ss.
event.allDayboolWhether the event spans full days.

onEventResized

Triggered when an event is resized and the final size differs from the original. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.idstringThe id of the event. Returns an empty string if not supplied.
event.startDatestringThe start date of the event.
event.startTimestringThe start time as HH:mm:ss.
event.endDatestringThe end date of the event. Returns None for single-day all-day events.
event.endTimestringThe end time as HH:mm:ss. Returns None for single-day all-day events.
event.allDayboolWhether the event spans full days.

onSelectionMade

Triggered when selectable is true and a range of dates has been selected. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.selectStartstringThe start of the selection.
event.selectEndstringThe end of the selection.
event.altKeybooleanWhether the Alt key was held when the event fired.
event.shiftKeybooleanWhether the Shift key was held when the event fired.

onEventCreated

Triggered when the built-in Create Event Popup is submitted. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.titlestringThe title entered for the new event.
event.startDatestringThe start date of the new event.
event.startTimestringThe start time as HH:mm:ss.
event.endDatestringThe end date of the new event.
event.endTimestringThe end time as HH:mm:ss.
event.eventColorstringThe event background and border color as a hex code.
event.eventTextColorstringThe event text color as a hex code.
event.allDayboolWhether the event spans full days.

onEventEdited

Triggered when the built-in Event Popup's edit mode has been used and submitted. Dates are returned as YYYY-MM-DD HH:mm:ss.

PropertyTypeDescription
event.titlestringThe updated title of the event.
event.startDatestringThe updated start date.
event.startTimestringThe updated start time as HH:mm:ss.
event.endDatestringThe updated end date.
event.endTimestringThe updated end time as HH:mm:ss.
event.eventColorstringThe event background and border color as a hex code.
event.eventTextColorstringThe event text color as a hex code.
event.allDayboolWhether the event spans full days.

onEventDeleted

Triggered when the delete button is pressed in the built-in Event Popup.

PropertyTypeDescription
event.idstringThe id of the event to delete. Returns an empty string if not supplied.

onEventReceived

Triggered when an event is dragged from an External Event Box and dropped onto the calendar.

PropertyTypeDescription
event.titlestringThe title of the received event.
event.startDatestringThe start date and time of the event.
event.startTimestringThe start time of the event.
event.endDatestringThe end date and time of the event.
event.endTimestringThe end time of the event.
event.allDaybooleanWhether the event is an all-day event.
event.eventColorstringThe background and border color of the event.
event.eventTextColorstringThe text color of the event.

Component Images

Light Mode

Calendar light mode

Dark Mode

Calendar dark mode

Event Popup

Event popup