View Source Luminous.TimeRange behaviour (luminous v2.5.0)
This module defines a struct with two fields (:from
and :to
) to represent a time range.
Additionally, various helper functions are defined that operate on time ranges.
It also specifies a behaviour that can be (optionally) implemented by client-side dashboards in order to override the dashboard's default time range (which is "today").
Link to this section Summary
Callbacks
Implement inside a client-side dashboard in order to return the dashboard's default time range.
Link to this section Types
@type t() :: %Luminous.TimeRange{from: DateTime.t(), to: DateTime.t()}
@type time_zone() :: binary()
Link to this section Callbacks
Implement inside a client-side dashboard in order to return the dashboard's default time range.
Link to this section Functions
@spec add(DateTime.t(), integer(), atom()) :: DateTime.t()
@spec default_time_zone() :: time_zone()
@spec from_unix(non_neg_integer(), non_neg_integer()) :: t()
@spec last_month(time_zone(), DateTime.t() | nil) :: t()
@spec last_n_days(non_neg_integer(), time_zone(), DateTime.t() | nil) :: t()
@spec last_week(time_zone(), DateTime.t() | nil) :: t()
@spec new(DateTime.t(), DateTime.t()) :: t()
@spec round(DateTime.t(), atom()) :: DateTime.t()
@spec this_month(time_zone(), DateTime.t() | nil) :: t()
@spec this_week(time_zone(), DateTime.t() | nil) :: t()
@spec today(time_zone(), DateTime.t() | nil) :: t()
@spec tomorrow(time_zone(), DateTime.t() | nil) :: t()
@spec yesterday(time_zone(), DateTime.t() | nil) :: t()