Sha256: 446ade89da76276eca65830bf435b49861a23ccc6d837dc21998a9edf67900d0

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

class DatepickerInput < SimpleForm::Inputs::StringInput
  def input(wrapper_options = nil)
    placeholder = options.delete(:placeholder) || 'Click to choose a date'

    input_html_options[:data] ||= {}
    input_html_options[:data][:datepicker] = true
    input_html_options[:data][:blank] = options.delete(:blank)

    if column.type == :datetime
      input_html_options[:data][:timepicker] = true
      input_html_options[:data][:timezone_utc_offset] = Time.zone.now.utc_offset
    end

    input_html_options[:placeholder] = placeholder
    input_html_options[:autocomplete] = 'off'

    super
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forest_cms-0.98.1 app/inputs/datepicker_input.rb