Class: Formtastic::Inputs::UiDatePickerInput
- Inherits:
-
StringInput
- Object
- StringInput
- Formtastic::Inputs::UiDatePickerInput
- Defined in:
- lib/formtastic/inputs/ui_date_picker_input.rb
Direct Known Subclasses
Instance Method Summary collapse
- #css_class ⇒ Object
- #format ⇒ Object
- #input_html_options ⇒ Object
- #localized(value) ⇒ Object
- #to_html ⇒ Object
- #value ⇒ Object
Instance Method Details
#css_class ⇒ Object
20 21 22 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 20 def css_class "ui-date-picker" end |
#format ⇒ Object
12 13 14 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 12 def format [:format] || '%d %b %Y' end |
#input_html_options ⇒ Object
24 25 26 27 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 24 def new_class = [super[:class], css_class].compact.join(" ") super.update(:class => new_class, :value => localized(value)) end |
#localized(value) ⇒ Object
29 30 31 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 29 def localized value value.nil? ? nil : I18n.localize(object.send(method)) end |
#to_html ⇒ Object
5 6 7 8 9 10 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 5 def to_html input_wrapping do label_html << builder.text_field(input_name, ) end end |
#value ⇒ Object
16 17 18 |
# File 'lib/formtastic/inputs/ui_date_picker_input.rb', line 16 def value [:value] || object.send(method).try(:strftime, format) end |