151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# File 'lib/active_scaffold/bridges/date_picker/helper.rb', line 151
def active_scaffold_search_date_picker_field(column, options, current_search, name, ui_options: column.options)
value =
if current_search.is_a? Hash
controller.class.condition_value_for_datetime(column, current_search[name], column.search_ui == :date_picker ? :to_date : :to_time)
else
current_search
end
options = ui_options.merge(options).except!(:include_blank, :discard_time, :discard_date, :value)
options = active_scaffold_input_text_options(options)
format = datepicker_format(options, column.search_ui)
options[:class] << " #{column.search_ui}"
options[:style] = 'display: none' if options[:show] == false options[:data] = datepicker_format_options(column, format).reverse_merge!(options[:data] || {})
value = l(value, :format => format) if value
options = options.merge(:id => "#{options[:id]}_#{name}", :name => "#{options[:name]}[#{name}]", :object => nil)
text_field_tag("#{options[:name]}[#{name}]", value, options)
end
|