Skip to main content

Example

{% date_grain_selector
    id="time_grain"
    default_value="month"
/%}

Attributes

id
String
required
The id of the date grain selector to be used in SQL query templates
preset_values
Array
Optional array of preset date grain values to show. If not provided, all date grain options will be available.
default_value
String
Default date grain to select on load
title
String
default:"Date Grain"
Text displayed above the selector
info
String
Information tooltip text
placeholder
String
Placeholder text displayed when no value is selected
icon
String
default:"clock"
Icon to display
width
Number
Set the width of this component (in percent) relative to the page width

Available Filter Properties

When you reference a date grain_selector filter in inline queries using the {{filter_id.property}} syntax, the following properties are available:

.selected

Returns the selected date grain value. Returns an empty string when no value is selected.

.literal

Returns the raw unescaped selected value.
I