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 Months 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 type

t() View Source
t() :: %Month.Range{end: Month.t(), months: [Month.t()], start: Month.t()}

Link to this section Functions

Link to this function

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()}

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.