Module: ActiveScaffold::Bridges::DatePickerBridge::DatepickerColumnHelpers
- Defined in:
- lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb
Instance Method Summary collapse
- #datepicker_format_options(column, format, options) ⇒ Object
- #datepicker_split_datetime_format(datetime_format) ⇒ Object
- #to_datepicker_format(rails_format) ⇒ Object
Instance Method Details
#datepicker_format_options(column, format, options) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 161 def (column, format, ) if column.form_ui == :date_picker js_format = to_datepicker_format(I18n.translate!("date.formats.#{format}")) ['date:dateFormat'] = js_format unless js_format.nil? else rails_time_format = I18n.translate!("time.formats.#{format}") date_format, time_format = datepicker_split_datetime_format(self.to_datepicker_format(rails_time_format)) ['date:dateFormat'] = date_format unless date_format.nil? unless time_format.nil? ['time:timeFormat'] = time_format ['time:ampm'] = true if rails_time_format.include?('%I') end end unless format == :default end |
#datepicker_split_datetime_format(datetime_format) ⇒ Object
153 154 155 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 153 def datepicker_split_datetime_format(datetime_format) ActiveScaffold::Bridges::DatePickerBridge.split_datetime_format(datetime_format) end |
#to_datepicker_format(rails_format) ⇒ Object
157 158 159 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 157 def to_datepicker_format(rails_format) ActiveScaffold::Bridges::DatePickerBridge.to_datepicker_format(rails_format) end |