Surface.Components.Form.DateSelect (surface v0.4.0) View Source
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 - The form identifier.
- id :string - The id prefix for underlying select fields.
- name :string - The name prefix for underlying select fields.
- field :string - 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.
Link to this section Summary
Functions
Callback implementation for Phoenix.LiveComponent.mount/1
.
Callback implementation for Phoenix.LiveComponent.render/1
.
Callback implementation for Phoenix.LiveComponent.update/2
.
Link to this section Functions
Callback implementation for Phoenix.LiveComponent.mount/1
.
Callback implementation for Phoenix.LiveComponent.render/1
.
Callback implementation for Phoenix.LiveComponent.update/2
.