month & shift navigation progress

This commit is contained in:
Adam Piontek 2021-03-15 15:46:59 -04:00
commit 4276399c20
20 changed files with 597 additions and 98 deletions
lib/shift73k/shifts

View file

@ -40,8 +40,10 @@ defmodule Shift73k.Shifts.Templates do
** (Ecto.NoResultsError)
"""
def get_shift_template!(nil), do: nil
def get_shift_template!(id), do: Repo.get!(ShiftTemplate, id)
def get_shift_template(nil), do: nil
def get_shift_template(id), do: Repo.get(ShiftTemplate, id)
@doc """

View file

@ -58,7 +58,7 @@ defmodule Shift73k.Shifts.Templates.ShiftTemplate do
[]
end
end)
|> validate_inclusion(:time_zone, Timex.timezones())
|> validate_inclusion(:time_zone, Timex.timezones(), message: "must be a valid IANA tz database time zone")
end
defp time_start_from_attrs(%{"time_start" => time_start}), do: time_start