316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
# File 'lib/active_scaffold/finder.rb', line 316
def condition_value_for_datetime(column, value, conversion = :to_time)
return if value.nil? || value.blank?
if value.is_a? Hash
local_time_from_hash(value, conversion)
elsif value.respond_to?(:strftime)
if conversion == :to_time
value.to_time.in_time_zone
else
value.send(conversion)
end
elsif conversion == :to_date
parse_date_with_format(*format_for_date(column, value))
elsif value.include?('T')
Time.zone.parse(value)
else time = parse_time_with_format(value, *format_for_datetime(column, value))
conversion == :to_time ? time : time.send(conversion)
end
end
|