View Source Luminous.TimeRange (luminous v0.9.1)

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()
Link to this function

from_iso(from_iso, to_iso)

View Source
@spec from_iso(binary(), binary()) :: t()
Link to this function

from_unix(from_unix, to_unix)

View Source
@spec from_unix(non_neg_integer(), non_neg_integer()) :: t()
@spec last_month(binary()) :: t()
@spec last_n_days(non_neg_integer(), binary()) :: t()
@spec last_week(binary()) :: t()
@spec new(DateTime.t(), DateTime.t()) :: t()
@spec next_n_days(non_neg_integer(), binary()) :: t()
@spec round(DateTime.t(), atom()) :: DateTime.t()
Link to this function

shift_zone!(time_range, time_zone)

View Source
@spec shift_zone!(t(), binary()) :: t()
@spec this_month(binary()) :: t()
@spec this_week(binary()) :: t()
@spec to_map(t()) :: map()
@spec today(binary()) :: t()
@spec tomorrow(binary()) :: t()
@spec yesterday(binary()) :: t()