View Source Luminous.TimeRangeSelector behaviour (luminous v1.0.0)
A selector represents the widget in the dashboard that allows for selecting a time range/period. It is defined at compile time and populated at compile time (current value). It can also be updated with a new value.
Link to this section Summary
Functions
Returns the default time range of the selector, in the given time zone.
Initialize and return a time range selector at compile time.
Calculates and returns the time range for the given preset in the given time zone.
Populate the selector's dynamic properties (e.g. current time range) at runtime.
Returns a list with the available time range presets.
Updates the current time range of the selector.
Link to this section Types
Link to this section Callbacks
@callback default_time_range(time_zone()) :: Luminous.TimeRange.t()
This behaviour needs to be implemented by the module that is passed to define/2
.
Link to this section Functions
@spec default_time_range(t(), time_zone()) :: Luminous.TimeRange.t()
Returns the default time range of the selector, in the given time zone.
Initialize and return a time range selector at compile time.
@spec get_time_range_for(t(), preset(), time_zone()) :: Luminous.TimeRange.t()
Calculates and returns the time range for the given preset in the given time zone.
Populate the selector's dynamic properties (e.g. current time range) at runtime.
@spec presets() :: [preset()]
Returns a list with the available time range presets.
@spec update_current(t(), Luminous.TimeRange.t()) :: t()
Updates the current time range of the selector.