11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/active_scaffold/bridges/date_picker/ext.rb', line 11
def initialize(model_id)
super
return unless ActiveScaffold::Bridges::DatePicker.default_ui
date_picker_fields = _columns.collect { |c| {:name => c.name.to_sym, :type => c.type} if %i[date datetime].include?(c.type) }.compact
return if date_picker_fields.empty?
date_picker_fields.each do |field|
col_config = columns[field[:name]]
col_config.form_ui = (field[:type] == :date ? :date_picker : :datetime_picker)
end
end
|