Skip to main content
Version: 4.60

calendar

Creates a swipeable calendar as a monthly view.

Field Configurations

KeyTypeDescriptionDefault Value
"activeMonthBackgroundColor"ColorThe background color for the dates of the current month of the current year."transparent"
"activeMonthFontColor"ColorThe font color for the dates of the current month of the current year."#000000"
"backgroundColor"ColorThe background color of the layer."transparent"
"firstDayOfWeek"FirstDayOfWeekFirst day of the week"mo"
"font"StringThe font to be used for the dates.null
"fontSize"UnitSizeThe font size for the dates.null
"highlightColor"ColorThe background color for the current date."#000000"
"highlightFontColor"ColorThe font color for the current date."#FFFFFF"
"inactiveMonthBackgroundColor"ColorThe background color for the dates of the month that is not current month."transparent"
"inactiveMonthFontColor"ColorThe font color for the dates of the month that is not current month."#000000"
"items"Arrayundefinednull
"lineColor"ColorBorder color for each date."transparent"
"maxDate"StringMaximum date to which the user can swipe.null
"minDate"StringMinimum date to which the user can swipe.null
"monthFont"StringThe font to be used for the month names displaying in header.null
"monthFontColor"ColorThe font color for months."#000000"
"monthFontSize"UnitSizeThe font size for the month names displaying in header.null
"monthFormat"StringFormat to display the current month."MMMM YYYY"
"query"StringQuery to retrieve data.null
"queryParams"ArrayParameters for the query.null
"scrollDirection"ScrollDirectionThe direction the calendar can scroll."vertical"
"selectionEvent"StringThe event to trigger when user selects a date in the calendar.null
"showMonth"BooleanDetermines whether the title should be displayed with the month.true
"startDate"StringDate with month that is at the beginning.null
"table"StringTable containing the calendar entriesnull
"template"StringTemplate for the data.null
"weekDayFont"StringThe font to be used for the weekday names.null
"weekDayFontColor"ColorThe font color for weekdays."#000000"

Inherited

From Base Layer

Base Layer

Field Configurations

KeyTypeDescriptionDefault Value
"_value"Value[PREVIEW] Dynamic value of the layer.null
"accessibilityAppendState"StringDefines this layer appends its state to the accessibility text.null
"accessibilityText"StringText for accessibility navigation. Can be translated.null
"actions"ActionListList of actions, which will be executed when the layer is tapped.null
"borderColor"ColorThe color of the border in hex color value.null
"borderRadius"UnitSizeThe radius applies to all corners; with a borderWidth of 0 the border is not drawn and radius is set anyway.0
"borderWidth"UnitSizeThe width of the border.0
"bottomLeftRadius"UnitSizeRadius for the bottom left corner.0
"bottomRightRadius"UnitSizeRadius for the bottom right corner.0
"classes"ArrayList of classes for layer styles.null
"conditions"ConditionsList of conditions to alter the layer state.null
"constraints"ConstraintsA list of constraints defining the position of the layer in a layout.null
"consumesKeyboard"BooleanThis layer will be used to shrink, if a keyboard is shown.null
"dataKey"StringName for assigning data to this layer.null
"focusColor"ColorThe highlight color of this layer when it is focused. Mainly used on TV. If no color is provided, the pressedColor will be used.null
"hidden"BooleanIndicates whether the layer is hidden. Default: false.false
"isAccessibilityElement"StringDefines if this layer is important for accessibility navigation. The default depends on the layer type.null
"layerRotation"NumberThe layer is rotated by the specified degree.0
"name"StringUnique name in the layout. Used for alignment or actions.null
"opacity"NumberThe opacity of the layer.1
"overInsetBottom"BooleanDetermines if this layer ignores the save space at the bottom of the device.false
"overInsetTop"BooleanDetermines if this layer ignores the save space at the top of the device.false
"pressedColor"ColorThe highlight color of this layer when it is pressed. Mainly used on TV. If no color is provided, the focusColor will be used.null
"safeArea"SafeAreaTypeObjectDetermines the safe area behaviour.null
"shadowElevation"NumberThe elevation of this layer for casting shadows.0
"state"StringThe state the layer will use as default."default"
"states"LayerStatesA list of named states that affect the appearance of the layer.null
"topLeftRadius"UnitSizeRadius for the top left corner.0
"topRightRadius"UnitSizeRadius for the top right corner.0
"touchFeedback"TouchFeedbackDetermines if the layer should show a touch feedback if touched."visible"
"trackingKey"StringDefines a key for a scroll event.null
"type"LayerTypeThe type of the layernull
"value"Value(Initial) value of the layer.null

Examples

Example 1: Create a custom themed calendar

Goal: Create a calendar with a custom color theme.

To achieve this the following code can be used:

{
"type": "calendar",
"activeMonthBackgroundColor": "#F3F3F3",
"activeMonthFontColor": "#2F96B4",
"inactiveMonthBackgroundColor": "#B1B2B2",
"inactiveMonthFontColor": "#BF4797",
"highlightColor": "#34A7C9",
"lineColor": "#34A7C9",
"monthFontColor": "#F3F3F3",
"weekDayFontColor": "#F3F3F3",
"constraints": [
{
"type": "pos",
"anchor": "c",
"x": "50%",
"y": "40%"
},
{
"type": "size",
"width": "90%",
"height": "60%"
}
]
}

The active and inactive month color fields set the background and font colors of the calendar.

Result:

Screenshot of the app showing the results of the sample code from Example 1.
A calendar has been created.