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

Generates select tags for date.

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

All options passed via opts will be sent to date_select/3, value, default, year, month, day and builder can be set directly and will override anything in opts.

Examples

<DateSelect form="user" field="born_at" />

<Form for={:user}>
  <DateSelect field={:born_at} />
</Form>

Properties

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

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

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

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

  • 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

  • year :keyword - Options passed to the underlying 'year' select

  • month :keyword - Options passed to the underlying 'month' select

  • day :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.