Class: DatePickerInput
- Inherits:
-
SimpleForm::Inputs::StringInput
- Object
- SimpleForm::Inputs::StringInput
- DatePickerInput
- Includes:
- ActionView::Context, ActionView::Helpers::FormTagHelper
- Defined in:
- app/inputs/date_picker_input.rb
Instance Method Summary collapse
Instance Method Details
#hint ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/inputs/date_picker_input.rb', line 18 def hint [:hint_html] ||= {} [:hint_html].merge!(id: hint_id, class: 'hidden') hint_text = 'Date (format: MM/DD/YYYY)' if [:input_html] && [:input_html]["disable-future-dates"] hint_text << '. You cannot select a future date.' end hint_text end |
#input ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/inputs/date_picker_input.rb', line 5 def input [:id] ||= date_id .reverse_merge!( placeholder: "MM/DD/YYYY", value: date_value, :"aria-describedby" => hint_id ) content_tag(:div, class: 'uc-form-field-date') do user_agent.mobile? ? input_for_mobile : input_for_desktop end end |
#label_html_options ⇒ Object
28 29 30 31 32 |
# File 'app/inputs/date_picker_input.rb', line 28 def [:input_html] ||= {} [:input_html][:id] ||= date_id super end |