# `OpenHours.Interval`
[🔗](https://github.com/hopsor/open_hours/blob/v1.0.1/lib/open_hours/interval.ex#L1)

This module contains functions for working with intervals of time.

# `t`

```elixir
@type t() :: {Time.t(), Time.t()}
```

A tuple of two Time structs representing the beginning and end of an interval.

# `difference`

```elixir
@spec difference([t()] | t(), [t()] | t()) :: [t()]
```

Calculates the difference between two intervals or two lists of intervals.

It always returns a list of intervals.

# `within?`

```elixir
@spec within?(t(), DateTime.t() | Time.t()) :: boolean()
```

Returns true if the interval contains the instant.

---

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