# `Koyomi.Month`
[🔗](https://github.com/hattoriai/koyomi/blob/v0.2.1/lib/koyomi/month.ex#L1)

An Ecto type for a month, stored in a `:date` column as the first day
of the month.

    field :billing_month, Koyomi.Month

The month picker posts `YYYY-MM` (`"2027-03"`), as the browser's own
month input does. The type casts it, a `Date` (any day of the month)
and a map with `"year"` and `"month"`. The value is the first day of
the month: `~D[2027-03-01]`.

# `embed_as`

# `equal?`

# `to_iso8601`

```elixir
@spec to_iso8601(Date.t()) :: String.t()
```

Writes a month as `YYYY-MM`.

## Examples

    iex> Koyomi.Month.to_iso8601(~D[2027-03-15])
    "2027-03"

---

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