Skip to main content
Basic Usage
{% 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 loadAllowed values:
  • day
  • week
  • month
  • quarter
  • year
  • hour
  • day of week
  • day of month
  • day of year
  • week of year
  • month of year
  • quarter of year
title
String
default:"Date Grain"
Text displayed above the selector
info
String
Information tooltip text
URL to link the info text to (can only be used with info)
Create a custom link title for the info link, placed after the info text (can only be used with info_link)
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.