Method: ActiveScaffold::Finder::ClassMethods#parse_date_with_format

Defined in:
lib/active_scaffold/finder.rb

#parse_date_with_format(value, format) ⇒ Object



294
295
296
297
298
299
300
301
# File 'lib/active_scaffold/finder.rb', line 294

def parse_date_with_format(value, format)
  Date.strptime(value, *format)
rescue StandardError => e
  message = "Error parsing date from #{value}"
  message << ", with format #{format}" if format
  Rails.logger.warn "#{message}:\n#{e.message}\n#{e.backtrace.join("\n")}"
  nil
end