View Source Surface.Components.Form.TimeSelect (surface v0.11.4)

Generates select tags for time.

Provides a wrapper for Phoenix.HTML.Form's time_select/3 function.

All options passed via opts will be sent to time_select/3, value, default, hour, minute, second and builder can be set directly and will override anything in opts.

Examples

<TimeSelect form="alarm" field="time" />

<Form for={:alarm}>
  <TimeSelect field={:time} />
</Form>

Properties

  • form :form, from_context: {Surface.Components.Form, :form} - The form identifier

  • field :any, from_context: {Surface.Components.Form.Field, :field} - The field name

  • id :string - The id prefix for underlying select fields

  • name :string - The name prefix for underlying select fields

  • value :any - Value to pre-populate the select

  • default :any - Default value to use when none was given in 'value' and none is available in the form data

  • hour :keyword - Options passed to the underlying 'day' select

  • minute :keyword - Options passed to the underlying 'day' select

  • second :keyword - Options passed to the underlying 'day' select

  • builder :fun - Specify how the select can be build. It must be a function that receives a builder that should be invoked with the select name and a set of options.

  • opts :keyword, default: [] - Options list

Summary

Functions

Callback implementation for Surface.Component.render/1.