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
170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 170 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
162 163 164 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 162 def datepicker_split_datetime_format(datetime_format) ActiveScaffold::Bridges::DatePickerBridge.split_datetime_format(datetime_format) end |
#to_datepicker_format(rails_format) ⇒ Object
166 167 168 |
# File 'lib/active_scaffold/bridges/date_picker/lib/datepicker_bridge.rb', line 166 def to_datepicker_format(rails_format) ActiveScaffold::Bridges::DatePickerBridge.to_datepicker_format(rails_format) end |