Is it possible to adapt path helpers to take a %Date{} struct as a param?
eg:
path = proj_apprvl_path(conn, :index, project, week_end_date)
ATM we are having to run:
week_end_date = Date.to_string(week_end_date)
path = proj_apprvl_path(conn, :index, project, week_end_date)
The route is defined:
scope "/projects/:proj_id", as: :proj do
get("/timecards/:week_end_date/approval", TimecardApprovalController, :index, as: "apprvl")
end
I can see from the Phoenix.Param docs that we can define a specific param for a given struct but I can’t see how to adapt for me because we are not passing a custom struct but the elixir %Date{}
one.
Unless I were to create a specific %WeekEndDate{}
struct, which I don’t think I want to.
Thanks a lot for any assistance.