Represents a range of months.
iex> range = Month.Range.new(~M[2019-01], ~M[2019-03])
{:ok, #Month.Range<~M[2019-01], ~M[2019-03]>}
iex> range.months
[~M[2019-01], ~M[2019-02], ~M[2019-03]]The months field contains all months within the range, inclusive.
Summary
Functions
Creates a new Month.Range using given Months as a start and an end.
Sames as new/2 but returs either result or raises an exception.
Types
Functions
@spec new(Date.t(), Date.t()) :: {:ok, t()} | {:error, String.t()}
@spec new(Month.t(), Month.t()) :: {:ok, t()} | {:error, String.t()}
Creates a new Month.Range using given Months as a start and an end.
Examples
iex> Month.Range.new(~M[2019-01], ~M[2019-03])
{:ok, #Month.Range<~M[2019-01], ~M[2019-03]>}
Sames as new/2 but returs either result or raises an exception.