Sha256: 8df560fd9d2aa164b4f3e678b9b125fec0a2a6a2941fba8bab04474461202217
Contents?: true
Size: 1008 Bytes
Versions: 9
Compression:
Stored size: 1008 Bytes
Contents
module SimpleForm module Inputs class DateTimeInput < Base def input(wrapper_options = nil) merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) if use_html5_inputs? @builder.send(:"#{input_type}_field", attribute_name, merged_input_options) else @builder.send(:"#{input_type}_select", attribute_name, input_options, merged_input_options) end end private def label_target if use_html5_inputs? attribute_name else position = case input_type when :date, :datetime date_order = input_options[:order] || I18n.t('date.order') date_order.first.to_sym else :hour end position = ActionView::Helpers::DateTimeSelector::POSITION[position] "#{attribute_name}_#{position}i" end end def use_html5_inputs? input_options[:html5] end end end end
Version data entries
9 entries across 9 versions & 3 rubygems