Skip to main content

Date Picker

Rocket 2.0

The Date Picker component is a field where users pick one date, or a start and end date, from a calendar. Use it for due dates, booking dates or report periods.

Properties​

Property
Description
Expected Value
LabelText shown above the field.Text. Default: Date
Help textA hint shown under the field.Text
ModeSingle picks one date; Range picks a start and end date across a two-month calendar.Single, Range. Default: Single
PlaceholderText shown in the field before a date is picked.Text. Default: Pick a date
Default (YYYY-MM-DD, or [start, end] for a range)The date the field starts with, as YYYY-MM-DD, or [start, end] in Range mode.Text
Display formatHow the picked date is written in the field, for example DD MMM YYYY or MM/DD/YYYY.Text. Default: DD MMM YYYY
Earliest date (YYYY-MM-DD)The earliest date users can pick. Earlier days are greyed out.Text
Latest date (YYYY-MM-DD)The latest date users can pick. Later days are greyed out.Text
Disabled datesDates users can't pick, as a list such as ['2026-12-25', '2026-12-26'].Array
Show clear buttonShows a button in the field that clears the picked date.On or off. Default: Off

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On selectTriggers when the picked date changes, from the calendar, the clear button or an action that sets a different date.
On focusTriggers when the field gets focus.
On blurTriggers when the field loses focus.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set valueSets the date in Single mode. Format says how Value is written; leave it empty to use the display format.components.datepicker1.setValue("", "")
Clear valueClears the picked date or range.components.datepicker1.clearValue()
Set value in timestampSets the date in Single mode from a Unix timestamp in milliseconds.components.datepicker1.setValueInTimestamp("")
Set start dateSets the start date in Range mode, read with Format when given.components.datepicker1.setStartDate("", "")
Set end dateSets the end date in Range mode, read with Format when given.components.datepicker1.setEndDate("", "")
Set date rangeSets both ends of the range in Range mode. Dates given in the wrong order are swapped.components.datepicker1.setDateRange("", "", "")
Clear start dateClears the start date in Range mode.components.datepicker1.clearStartDate()
Clear end dateClears the end date in Range mode.components.datepicker1.clearEndDate()
Clear date rangeClears both dates in Range mode.components.datepicker1.clearDateRange()
Set min dateChanges the earliest date users can pick.components.datepicker1.setMinDate("")
Set max dateChanges the latest date users can pick.components.datepicker1.setMaxDate("")
Set disabled datesReplaces the list of dates users can't pick.components.datepicker1.setDisabledDates("")
Clear disabled datesMakes all dates pickable again.components.datepicker1.clearDisabledDates()
Set focusMoves keyboard focus to the field.components.datepicker1.setFocus()
Set blurCloses the calendar and removes focus from the field.components.datepicker1.setBlur()
Set dateSets the date in Single mode from a YYYY-MM-DD value.components.datepicker1.setDate("")
Set visibilityShows the component when true, hides it when false.components.datepicker1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.datepicker1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.datepicker1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the field.{{components.datepicker1.label}}
descriptionA hint shown under the field.{{components.datepicker1.description}}
modeSingle picks one date; Range picks a start and end date across a two-month calendar.{{components.datepicker1.mode}}
placeholderText shown in the field before a date is picked.{{components.datepicker1.placeholder}}
defaultValueThe date the field starts with, as YYYY-MM-DD, or [start, end] in Range mode.{{components.datepicker1.defaultValue}}
formatHow the picked date is written in the field, for example DD MMM YYYY or MM/DD/YYYY.{{components.datepicker1.format}}
minDateThe earliest date users can pick. Earlier days are greyed out.{{components.datepicker1.minDate}}
maxDateThe latest date users can pick. Later days are greyed out.{{components.datepicker1.maxDate}}
disabledDatesDates users can't pick, as a list such as ['2026-12-25', '2026-12-26'].{{components.datepicker1.disabledDates}}
showClearBtnShows a button in the field that clears the picked date.{{components.datepicker1.showClearBtn}}
valueThe picked date as YYYY-MM-DD, or [start, end] in Range mode.{{components.datepicker1.value}}
startDateThe start date in Range mode, as YYYY-MM-DD.{{components.datepicker1.startDate}}
endDateThe end date in Range mode, as YYYY-MM-DD.{{components.datepicker1.endDate}}
unixTimestampThe picked date as a Unix timestamp in milliseconds, in Single mode.{{components.datepicker1.unixTimestamp}}
displayValueThe date or range as shown in the field, in the display format.{{components.datepicker1.displayValue}}
startDateInUnixThe start date as a Unix timestamp in milliseconds.{{components.datepicker1.startDateInUnix}}
endDateInUnixThe end date as a Unix timestamp in milliseconds.{{components.datepicker1.endDateInUnix}}
selectedDateRangeThe range as shown in the field, for example 01 Dec 2026 – 05 Dec 2026.{{components.datepicker1.selectedDateRange}}
dateFormatThe display format the field uses.{{components.datepicker1.dateFormat}}
isVisibleWhether the component is visible.{{components.datepicker1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.datepicker1.isLoading}}
isDisabledWhether the component is disabled.{{components.datepicker1.isDisabled}}

Styles​

Style
Default
Label colorTheme: Primary text
Help text colorTheme: Placeholder text
Field backgroundTheme: Surface 1
Field text colorTheme: Primary text
Placeholder colorTheme: Placeholder text
Field border colorTheme: Default border
Accent (focus ring, selection)Theme: Brand primary
Error color (message and border)Theme: Error
Field radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.