     "#{hour}#{minute} " <> am_pm
   end
 
-  def parse(nil) do
-    DateTime.utc_now()
+  def parse(dt, _offset \\ 0) do
+    case DateTime.from_iso8601(dt) do
+      {:ok, result, _} ->
+        result
+
+      _ ->
+        case DateTime.from_iso8601(dt <> "Z") do
+          {:ok, result, _} -> result
+          _ -> Timex.now()
+        end
+    end
   end
 
   def zero_pad(int) do
     str = "#{int}"
     if String.length(str), do: str, else: "0#{str}"
-  end
-
-  def parse(dt = %DateTime{}) do
-    dt
-  end
-
-  def parse(dt) do
-    {:ok, result, _} = DateTime.from_iso8601(dt)
-    result
   end
 
   def flatten(%{} = map) do

        Ak.Signup.process_signup(&String.contains?(&1["title"], "ESM: Event Message Host"), info)
      )
    end
  end

  def exec(hook_type = "message_attendees" <> _rest, ~m(event attendee_emails message)a) do
    hook = Cosmic.get(@cosmic_config_slug) |> get_in(["metadata", hook_type])
    IO.puts("Posting webhook to #{hook} because of #{hook_type}")
    IO.inspect(HTTPotion.post(hook, bodify(~m(event attendee_emails message))))
  end

  def exec(

    IO.inspect(HTTPotion.post(hook, bodify(~m(event old_survey new_survey changes candidate))))
  end

  def exec(hook_type = "message_attendees" <> _rest, ~m(event attendee_emails message)a) do
    hook = Cosmic.get(@cosmic_config_slug) |> get_in(["metadata", hook_type])
    IO.puts("Posting webhook to #{hook} because of #{hook_type}")
    IO.inspect(HTTPotion.post(hook, bodify(~m(event attendee_emails message))))
  end

  def exec("important_change", ~m(event attendee_emails)a) do
    %{"metadata" => %{"message_attendees_date_time_changed" => hook}} =
      Cosmic.get(@cosmic_config_slug)

    if attendee_emails == "" do
      IO.puts("Not posting webhook to #{hook} because no one is attending")
    else
      IO.puts("Posting webhook to #{hook} because of important_change")
      IO.inspect(HTTPotion.post(hook, bodify(~m(event attendee_emails))))
    end
  end

