   end
 
   def form_time(form, field, opts \\ []) do
-    value = Map.get(form.source.changes, field) || opts[:value] || %{hour: 0, minute: 0}
+    value = Changeset.get_field(form.source, field) || opts[:value] || %{hour: 0, minute: 0}
     class = opts[:class] || ""
     label = opts[:label] || humanize(field)
     {error, _} = Keyword.get form.errors, field, {nil, nil}

defmodule CoursePlanner.SharedView do
  @moduledoc false
  use CoursePlanner.Web, :view

  # helpers

  def path_exact_match(conn, path) do

  end

  def form_date(form, field, opts \\ []) do
    value = Changeset.get_field(form.source, field) || opts[:value] || Date.utc_today()
    class = opts[:class] || ""
    label = opts[:label] || humanize(field)
    {error, _} = Keyword.get form.errors, field, {nil, nil}
