Skip to main content

Date Time Picker

Rocket 2.0

The Date Time Picker component is a field where users pick a date from a calendar and a time of day. Use it for appointments, deadlines or scheduled jobs.

Properties​

Property
Description
Expected Value
LabelText shown above the field.Text. Default: Date and time
Help textA hint shown under the field.Text
PlaceholderText shown in the field before a date and time are picked.Text. Default: Pick a date and time
Default value (YYYY-MM-DD HH:mm)The date and time the field starts with, as YYYY-MM-DD HH:mm.Text
Date display formatHow the date part is written in the field, for example DD MMM YYYY or MM/DD/YYYY.Text. Default: DD MMM YYYY
Time formatShows times on a 12-hour clock with AM and PM, or on a 24-hour clock.12h, 24h. Default: 12h
Minute stepThe gap between the minutes users can pick, for example 15 for :00, :15, :30 and :45.Number. Default: 5
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 and time.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 user picks or clears a date or time.
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 and time. Format says how Value is written; leave it empty to use the field's display format.components.datetimepicker1.setValue("", "")
Set value in timestampSets the date and time from a Unix timestamp in milliseconds.components.datetimepicker1.setValueInTimestamp("")
Set timeSets the time of day and keeps the picked date, or uses today when none is picked.components.datetimepicker1.setTime("", "")
Clear valueClears the picked date and time.components.datetimepicker1.clearValue()
Set min dateChanges the earliest date users can pick.components.datetimepicker1.setMinDate("")
Set max dateChanges the latest date users can pick.components.datetimepicker1.setMaxDate("")
Set disabled datesReplaces the list of dates users can't pick.components.datetimepicker1.setDisabledDates("")
Clear disabled datesMakes all dates pickable again.components.datetimepicker1.clearDisabledDates()
Set focusMoves keyboard focus to the field.components.datetimepicker1.setFocus()
Set blurCloses the picker and removes focus from the field.components.datetimepicker1.setBlur()
Set visibilityShows the component when true, hides it when false.components.datetimepicker1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.datetimepicker1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.datetimepicker1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the field.{{components.datetimepicker1.label}}
descriptionA hint shown under the field.{{components.datetimepicker1.description}}
placeholderText shown in the field before a date and time are picked.{{components.datetimepicker1.placeholder}}
defaultValueThe date and time the field starts with, as YYYY-MM-DD HH:mm.{{components.datetimepicker1.defaultValue}}
dateFormatHow the date part is written in the field, for example DD MMM YYYY or MM/DD/YYYY.{{components.datetimepicker1.dateFormat}}
timeFormatShows times on a 12-hour clock with AM and PM, or on a 24-hour clock.{{components.datetimepicker1.timeFormat}}
minuteStepThe gap between the minutes users can pick, for example 15 for :00, :15, :30 and :45.{{components.datetimepicker1.minuteStep}}
minDateThe earliest date users can pick. Earlier days are greyed out.{{components.datetimepicker1.minDate}}
maxDateThe latest date users can pick. Later days are greyed out.{{components.datetimepicker1.maxDate}}
disabledDatesDates users can't pick, as a list such as ['2026-12-25', '2026-12-26'].{{components.datetimepicker1.disabledDates}}
showClearBtnShows a button in the field that clears the picked date and time.{{components.datetimepicker1.showClearBtn}}
valueThe picked date and time as YYYY-MM-DDTHH:mm in local time.{{components.datetimepicker1.value}}
selectedDateThe picked date as YYYY-MM-DD.{{components.datetimepicker1.selectedDate}}
selectedTimeThe picked time as HH:mm on a 24-hour clock.{{components.datetimepicker1.selectedTime}}
unixTimestampThe picked date and time as a Unix timestamp in milliseconds.{{components.datetimepicker1.unixTimestamp}}
displayValueThe date and time as shown in the field.{{components.datetimepicker1.displayValue}}
isVisibleWhether the component is visible.{{components.datetimepicker1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.datetimepicker1.isLoading}}
isDisabledWhether the component is disabled.{{components.datetimepicker1.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—
Calendar icon colorTheme: Primary text
Popover backgroundTheme: Surface 1
Popover text colorTheme: Primary text
Popover item hover backgroundTheme: Surface 3
Selected item text color (on the accent)Theme: Surface 1
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.