Skip to main content

The Date Picker component for Retool Mobile

An input field to select or enter a date.

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.

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Configurability Inspector > Interaction > Disabled
Default
false
Examples
true

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
Configurability Inspector

events

A list of configured event handlers that trigger actions or queries.

Type array
Array values object
Configurability Inspector > Interaction > Event handlers
Array Object Properties

event

The event that triggers the action. Refer to the events section for details of available events for this object.

Type string
Configurability Inspector > Interaction > Event handlers > Event

method

The JavaScript method to perform when type is datasource, widget, state, or localStorage.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Run script actions

type

The type of action to perform.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Action
Allowed Values
ValueDescription
datasource

Control query.

widget

Control component.

script

Run script.

state

Set variable.

localStorage

Set localStorage.

util

Perform utility action (e.g., Open URL or Confetti).



hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Configurability Inspector > Appearance > Hidden
Default
false
Examples
true


labelCaption

The additional text to display with the label.

Type string
Format Plain Text
Configurability Inspector > Content > Add-ons > Label > Caption

manageTimeZone

Whether to adjust the value and display value of time zones using valueTimeZone and displayTimeZone respectively.

Type unknown
Configurability Inspector

mode

How to render images to fit.

Type string
Configurability Inspector
Allowed Values
ValueDescription
cover

Scale the image to fit the area while preserving the aspect ratio.

center

Center the image.

stretch

Resize the image to the same dimensions as the area.

contain

Scale and clip the image to fit the area while preserving the aspect ratio.


placeholder

The text to display within the input field when there is no value.

Type string
Formatstring
Configurability Inspector > Content > Placeholder
Default
Enter a value
Examples
Enter a value

timeZoneValue

The time zone (UTC offset) to encode in value. Select local to use the time zone reported by the user's browser.

Type unknown
Configurability Inspector

Examples
Hello world!

Methods

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

datePicker.clearValidation()

Clear the validation message from the input field.

Definition
datePicker.clearValidation()
Examples

Clear the validation message from datePicker.

datePicker.clearValidation();

datePicker.clearValue()

Clear the current values.

Definition
datePicker.clearValue()
Examples

Clear the current value of datePicker.

datePicker.clearValue();

datePicker.focus()

Set focus on the input field.

Definition
datePicker.focus()
Examples

Set focus on datePicker.

datePicker.focus();

datePicker.resetValue()

Reset the current value to the default value.

Definition
datePicker.resetValue()
Examples

Reset the current value of datePicker.

datePicker.resetValue();

datePicker.setDisabled()

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.

Definition
datePicker.setDisabled(disabled)
Parameters

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Disable datePicker.

datePicker.setDisabled(true);

Enable datePicker.

datePicker.setDisabled(false);

datePicker.setHidden()

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

Definition
datePicker.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide datePicker.

datePicker.setHidden(true);

Unhide datePicker.

datePicker.setHidden(false);

datePicker.setValue()

Sets the value of the date picker.

Definition
datePicker.setValue(key, value)
Parameters

key

The key.

Type string

value

The value.

Type string | number | boolean | object | array

Examples

Set the current value of datePicker to userValue.

datePicker.setValue(userValue);

datePicker.validate()

Validates the value of the input field.

Definition
datePicker.validate()
Examples

Validate the value of datePicker.

datePicker.validate();

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
ChangeThe value is changed.