Skip to main content

The Calendar component for Retool Apps

A content area to display calendar events.

Calendar uses the FullCalendar library.

For more information on using the Calendar component, refer to the getting started guide.

Properties

All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

changeSet

Edited values for each row.

Type array
Format Custom data
Array values object
Mutability Read-only

colorByIndex

A list of colors for each item, by index.

Type array
Array values string
Mutability Read-only

data

The data.

Type string | number | boolean | object | array
Format Custom data
Mutability
ControlUsage
Retool UI Inspector
MethodcopyToClipboard()

dayMaxEvents

The maximum number of events to display, per day, when viewType is month. If not set, events stack to the height of the cell.

Type number
Mutability
ControlUsage
Retool UI Inspector

displayAllDaySlot

Whether to display the all-day event slot.

Type boolean
Mutability
ControlUsage
Retool UI Inspector

displayEventTime

Whether to display event times.

Type boolean
Mutability
ControlUsage
Retool UI Inspector

displayTimeZone

The time zone (UTC offset) that applies to the display value. Uses the time zone reported by the browser if set to local.

Type string
Mutability
ControlUsage
Retool UI Inspector

displayWeekends

Whether to display weekends.

Type boolean
Mutability
ControlUsage
Retool UI Inspector

endByIndex

A list of end times, by index.

Type array
Array values string
Mutability Read-only

eventIdByIndex

A list of event IDs, by index.

Type array
Array values string
Mutability Read-only

eventMaxStack

The maximum number of events to display in a stack.

Type number
Mutability
ControlUsage
Retool UI Inspector

firstDayOfWeek

The first day of the week, by index, with Sunday as 0.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
0

Sunday.

1

Monday.

2

Tuesday.

3

Wednesday.

4

Thursday.

5

Friday.

6

Saturday.


groupIdByIndex

A list of group IDs for each item, by index.

Type array
Array values number
Mutability Read-only

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

hoveredEvent

The event on which the cursor hovers.

Type object
Mutability Read-only

id

The unique identifier (name).

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector
Default
calendar1
Examples
query1
button1

initialDate

The initial date to display.

Type string
Mutability
ControlUsage
Retool UI Inspector

isHiddenOnDesktop

Whether to show or hide this object in the desktop layout.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Show on desktop
Default
false
Examples
true

isHiddenOnMobile

Whether to show or hide this object in the mobile layout.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Show on mobile
Default
true
Examples
true

itemMode

The configuration mode for options.

Type string
Mutability
ControlUsage
Retool UI Inspector > Content > Options
Allowed Values
ValueUI OptionDescription
dynamicMapped

Options dynamically mapped from an array.

staticManual

Options manually configured in the IDE.

Default
dynamic
Examples
"dynamic"

listType

The date range to display in list view.

Type string
Mutability Read-only
Allowed Values
ValueDescription
day

Day

week

Week

month

Month

year

Year


maintainSpaceWhenHidden

Whether to take up space on the canvas if hidden is true.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Maintain space when hidden
Default
false
Examples
true

margin

The amount of margin to render outside.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Margin
Allowed Values
ValueUI OptionDescription
4px 8pxNormal

Normal margin.

0None

No margin.

Default
4px 8px
Examples
4px 8px

selectedEvent

The selected event.

Type object
Mutability Read-only

selectedInterval

The selected interval.

Type object
Mutability Read-only

showInEditor

Whether the component remains visible in the editor if hidden is true.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Always show in edit mode
Default
false
Examples
true

startByIndex

A list of start times, by index.

Type array
Array values string
Mutability Read-only

style

Custom style options.

Type object
Mutability
ControlUsage
Retool UI Inspector > Appearance > style

timeFormat

The format of the time.

Type string
Mutability
ControlUsage
Retool UI Inspector

titleByIndex

A list of item titles, by index.

Type array
Array values string
Mutability Read-only

view

The view.

Type string
Mutability Read-only
Allowed Values
ValueDescription
day

Day

week

Week

month

Month

year

Year

list

List


viewType

The type of view to display.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
day

Day view.

week

Week view.

month

Month view.


Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

calendar.scrollIntoView()

Scrolls the canvas or parent container so that the selected component appears in the visible area.

Definition
calendar.scrollIntoView(options)
Parameters

options

The scroll options.

Type object
Object Properties

behavior

The scroll behavior.

Type string
Allowed Values
ValueDescription
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.


block

The scroll position relative to the component.

Type string
Allowed Values
ValueDescription
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.



Examples

Scroll the minimum amount to immediately bring calendar into view.

calendar.scrollIntoView({behavior: 'auto', block: 'nearest'});

calendar.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
calendar.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide calendar.

calendar.setHidden(true);

Unhide calendar.

calendar.setHidden(false);

Events

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription
Change EventAn event is changed.
Click EventAn event is clicked or pressed.
Create EventAn event is created.
Remove EventAn event is removed.