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

last_month(tz, now \\ nil)

View Source
@spec last_month(binary(), DateTime.t() | nil) :: t()
Link to this function

last_n_days(n, tz, now \\ nil)

View Source
@spec last_n_days(non_neg_integer(), binary(), DateTime.t() | nil) :: t()
Link to this function

last_week(tz, now \\ nil)

View Source
@spec last_week(binary(), DateTime.t() | nil) :: t()
@spec new(DateTime.t(), DateTime.t()) :: 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()
Link to this function

this_month(tz, now \\ nil)

View Source
@spec this_month(binary(), DateTime.t() | nil) :: t()
Link to this function

this_week(tz, now \\ nil)

View Source
@spec this_week(binary(), DateTime.t() | nil) :: t()
@spec to_map(t()) :: map()
@spec today(binary(), DateTime.t() | nil) :: t()
Link to this function

tomorrow(tz, now \\ nil)

View Source
@spec tomorrow(binary(), DateTime.t() | nil) :: t()
Link to this function

yesterday(tz, now \\ nil)

View Source
@spec yesterday(binary(), DateTime.t() | nil) :: t()