View Source Surface.Components.Form.DateTimeSelect (surface v0.11.5)
Generates select tags for datetime.
Provides a wrapper for Phoenix.HTML.Form's datetime_select/3
function.
All options passed via opts
will be sent to datetime_select/3
,
value
, default
, year
, month
, day
, hour
, minute
, second
and builder
can be set directly and will override anything in opts
.
Examples
<DateTimeSelect form="user" field="born_at" />
<Form for={:user}>
<DateTimeSelect field={:born_at} />
</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
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
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
.
Functions
Callback implementation for Surface.Component.render/1
.