The Date Range component for Retool Apps
An input field to select or enter a date range.
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.
endPlaceholder
The text to display in the input field when the end date is empty.
Type | string | ||||
Mutability |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
startPlaceholder
The text to display in the input field when the start date is empty.
Type | string | ||||
Mutability |
|
style
Custom style options.
Type | object | ||||
Mutability |
|
textBetween
The text to display between selected dates.
Type | string | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
dateRange.clearValidation()
Examples
Clear the validation message from dateRange
.
dateRange.clearValidation();
dateRange.clearValue()
Examples
Clear the current value of dateRange
.
dateRange.clearValue();
dateRange.focus()
Examples
Set focus on dateRange
.
dateRange.focus();
dateRange.resetValue()
Examples
Reset the current value of dateRange
.
dateRange.resetValue();
dateRange.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
dateRange.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring dateRange
into view.
dateRange.scrollIntoView({behavior: 'auto', block: 'nearest'});
dateRange.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
dateRange.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable dateRange
.
dateRange.setDisabled(true);
Enable dateRange
.
dateRange.setDisabled(false);
dateRange.setEndRange(end)
dateRange.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
dateRange.setHidden(hidden)
Parameters
Examples
true
Examples
Hide dateRange
.
dateRange.setHidden(true);
Unhide dateRange
.
dateRange.setHidden(false);
dateRange.setRange(options)
dateRange.setStartRange(start)
dateRange.setValue(value)
Examples
Set the current value of dateRange
to userValue
.
dateRange.setValue(userValue);
dateRange.validate()
Examples
Validate the value of dateRange
.
dateRange.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.
Event | Description |
---|---|
Blur | The input field is deselected. |
Change | The value is changed. |
Focus | The input field is selected. |
Submit | The value is submitted. |