<%= exam.date %> |
<%= case Date.diff(exam.date, Date.utc_today()) do
0 -> gettext("Today")
1 -> gettext("Tomorrow")
x when x > 1 -> "#{x} #{gettext("days left")}"
x when x < 0 -> "#{x*-1} #{gettext("days passed")}"
end %>
<.modal :if={@live_action in [:new, :edit]} id="exam-modal" show on_cancel={JS.patch(~p"/exams")}>
<.live_component
module={ExmrWeb.ExamLive.FormComponent}
id={@exam.id || :new}
title={@page_title}
action={@live_action}
exam={@exam}
patch={~p"/exams"}
/>