RelativeTime (relative_time v0.3.0)
Link to this section Summary
Types
A marker is a specific point in time that is accessible in a relative time term
Link to this section Types
Link to this type
edge()
Specs
edge() :: :past | :future
Link to this type
edge_option()
Specs
edge_option() :: {:edge, edge()}
Link to this type
input()
Specs
input() :: String.t()
Link to this type
marker()
Specs
marker() :: {atom(), DateTime.t()}
A marker is a specific point in time that is accessible in a relative time term
The keyword now
is also a marker, and it is possible to set a custom now
marker to override it, for testing purposes for example.
Link to this type
markers()
Specs
markers() :: {:markers, [marker()]}
Link to this type
option()
Specs
option() :: markers() | edge_option()
Link to this type
options()
Specs
options() :: [option()]
Link to this type
unit()
Specs
unit() :: :second | :minute | :hour | :day | :week | :month | :year
Link to this section Functions
Link to this function
from(input, opts \\ [])
Specs
from(input(), options()) :: {:ok, DateTime.t()} | {:error, any()}
Link to this function
to(input, opts \\ [])
Specs
to(input(), options()) :: {:ok, DateTime.t()} | {:error, any()}