An Ecto type for a month, stored in a :date column as the first day
of the month.
field :billing_month, Koyomi.MonthThe 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].
Summary
Functions
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Writes a month as YYYY-MM.
Functions
Callback implementation for Ecto.Type.embed_as/1.
Callback implementation for Ecto.Type.equal?/2.
Writes a month as YYYY-MM.
Examples
iex> Koyomi.Month.to_iso8601(~D[2027-03-15])
"2027-03"