# `Month.Range`
[🔗](https://github.com/svileng/month/blob/2.2.0/lib/month/range.ex#L1)

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.

# `t`

```elixir
@type t() :: %Month.Range{end: Month.t(), months: [Month.t()], start: Month.t()}
```

# `new`

```elixir
@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 `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]>}

# `new!`

```elixir
@spec new!(Date.t(), Date.t()) :: t()
@spec new!(Month.t(), Month.t()) :: t()
```

Sames as `new/2` but returs either result or raises an exception.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
