Month v2.1.0 Month.Range View Source
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.
Link to this section Summary
Functions
Creates a new Month.Range
using given Month
s as a start and an end
Sames as new/2
but returs either result or raises an exception
Link to this section Types
Link to this section Functions
Link to this function
new(first, last)
View Source
new(first, last)
View Source
new(Date.t(), Date.t()) :: {:ok, Month.Range.t()} | {:error, String.t()}
new(Month.t(), Month.t()) :: {:ok, Month.Range.t()} | {:error, String.t()}
new(Date.t(), Date.t()) :: {:ok, Month.Range.t()} | {:error, String.t()}
new(Month.t(), Month.t()) :: {:ok, Month.Range.t()} | {:error, String.t()}
Creates a new Month.Range
using given Month
s 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]>}
Link to this function
new!(first, last)
View Source
new!(first, last)
View Source
new!(Date.t(), Date.t()) :: Month.Range.t()
new!(Month.t(), Month.t()) :: Month.Range.t()
new!(Date.t(), Date.t()) :: Month.Range.t()
new!(Month.t(), Month.t()) :: Month.Range.t()
Sames as new/2
but returs either result or raises an exception.