Passing [disabled: true]
does not seem to disable time_select/3
. (I’m using a custom builder function:
def time_builder(form, field, opts \\ []) do
builder = fn b ->
assigns = %{}
~H"""
<%= b.(:hour, [options: Keyword.get(opts, :hours, hours), class: Keyword.get(opts, :class), size: 1]) %>
<%= b.(:minute, [options: Keyword.get(opts, :minutes, Enum.map(0..60, & &1)), class: Keyword.get(opts, :class), size: 1]) %>
"""
end
time_select(form, field, [builder: builder] ++ opts)
# implementation example
<%= time_builder(f, :start_time, [disabled: true]) %>
FWIW I’d use time_input
if it let me enforce 15 minute increments.