module SimpleForm::Bootstrap::FormBuilders::DateTime

Constants

DATE_COLUMN_TYPES
DATE_TIME_COLUMN_TYPES

Public Instance Methods

default_input_type(attribute_name, column, options, *args, &block) click to toggle source
Calls superclass method
# File lib/simple_form/bootstrap/form_builders/date_time.rb, line 14
def default_input_type(attribute_name, column, options, *args, &block)
  if (options.is_a?(Hash) ? options[:as] : @options[:as]).nil? && !column.nil?
    type = column.respond_to?(:type) ? column.type : column.sql_type
    return :bootstrap_date_time if DATE_TIME_COLUMN_TYPES.include?(type)
    return :bootstrap_date if DATE_COLUMN_TYPES.include?(type)
  end

  super(attribute_name, column, options, *args, &block)
end