Sha256: 6a88b586fe554be1591a80828740f5b9ba9b1ad41c1805764fc77b00f917f163

Contents?: true

Size: 526 Bytes

Versions: 14

Compression:

Stored size: 526 Bytes

Contents

class AdminDateInput < SimpleForm::Inputs::Base

  include AdminBaseInput

  def input(wrapper_options)
    format = if column.type == :datetime then '%Y/%m/%d %H:%M' else '%Y/%m/%d' end
    default_input_html_options = {class: "#{column.type}picker",
      value: @builder.object.send(attribute_name).nil? ? "" : @builder.object.send(attribute_name).strftime(format)}
    options = merge_options(default_input_html_options, input_html_options)
    return "#{@builder.text_field(attribute_name, options)}".html_safe
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
carnival-0.2.7 app/inputs/admin_date_input.rb
carnival-0.2.6 app/inputs/admin_date_input.rb
carnival-0.2.5 app/inputs/admin_date_input.rb
carnival-0.2.4 app/inputs/admin_date_input.rb
carnival-0.2.3 app/inputs/admin_date_input.rb
carnival-0.1.10 app/inputs/admin_date_input.rb
carnival-0.2.2 app/inputs/admin_date_input.rb
carnival-0.2.1 app/inputs/admin_date_input.rb
carnival-0.2.0 app/inputs/admin_date_input.rb
carnival-0.1.9 app/inputs/admin_date_input.rb
carnival-0.1.8 app/inputs/admin_date_input.rb
carnival-0.1.7 app/inputs/admin_date_input.rb
carnival-0.1.6 app/inputs/admin_date_input.rb
carnival-0.1.5 app/inputs/admin_date_input.rb