View Source Luminous.TimeRange (luminous v1.3.3)
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.
Link to this section Summary
Link to this section Types
@type t() :: %Luminous.TimeRange{from: DateTime.t(), to: DateTime.t()}
Link to this section Functions
@spec add(DateTime.t(), integer(), atom()) :: DateTime.t()
@spec from_unix(non_neg_integer(), non_neg_integer()) :: t()
@spec last_month(binary(), DateTime.t() | nil) :: t()
@spec last_n_days(non_neg_integer(), binary(), DateTime.t() | nil) :: t()
@spec last_week(binary(), DateTime.t() | nil) :: t()
@spec new(DateTime.t(), DateTime.t()) :: t()
@spec round(DateTime.t(), atom()) :: DateTime.t()
@spec this_month(binary(), DateTime.t() | nil) :: t()
@spec this_week(binary(), DateTime.t() | nil) :: t()
@spec today(binary(), DateTime.t() | nil) :: t()
@spec tomorrow(binary(), DateTime.t() | nil) :: t()
@spec yesterday(binary(), DateTime.t() | nil) :: t()