module Formtastic::DateTimePicker

Protected Instance Methods

datetime_picker_input(method, options = {}) click to toggle source
# File lib/formtastic_datepicker_inputs.rb, line 34
def datetime_picker_input(method, options = {})
  format = options[:format] || DATE_FORMATS[:default] || '%d %b %Y %H:%M'
  string_input(method, datetime_picker_options(format, object.send(method)).merge(options))
end
datetime_picker_options(format, value = nil) click to toggle source

Generate html input options for the datepicker_input

# File lib/formtastic_datepicker_inputs.rb, line 41
def datetime_picker_options(format, value = nil)
      {:wrapper_html => {:class => 'datetime'},:input_html => {:class => 'ui-datetime-picker',:value => value.try(:strftime, format)}}
end