Method: ActionView::Helpers::FormTagHelper#datetime_field_tag

Defined in:
actionview/lib/action_view/helpers/form_tag_helper.rb

#datetime_field_tag(name, value = nil, options = {}) ⇒ Object Also known as: datetime_local_field_tag

Creates a text field of type “datetime-local”.

Options

Supports the same options as #text_field_tag. Additionally, supports:

  • :min - The minimum acceptable value.

  • :max - The maximum acceptable value.

  • :step - The acceptable value granularity.

  • :include_seconds - Include seconds in the output timestamp format (true by default).



801
802
803
# File 'actionview/lib/action_view/helpers/form_tag_helper.rb', line 801

def datetime_field_tag(name, value = nil, options = {})
  text_field_tag(name, value, options.merge(type: "datetime-local"))
end