class SimpleForm::Inputs::DateTimeInput

Public Instance Methods

input() click to toggle source
# File lib/simple_form/inputs/date_time_input.rb, line 4
def input
  @builder.send(:"#{input_type}_select", attribute_name, input_options, input_html_options)
end

Private Instance Methods

label_target() click to toggle source
# File lib/simple_form/inputs/date_time_input.rb, line 10
def label_target
  position = case input_type
  when :date, :datetime
    date_order = input_options[:order] || I18n.t('date.order')
    date_order.first
  else
    :hour
  end

  position = ActionView::Helpers::DateTimeSelector::POSITION[position]
  "#{attribute_name}_#{position}i"
end