Method: Blacklight::Types::Date#cast

Defined in:
app/values/blacklight/types.rb

#cast(input) ⇒ Object



56
57
58
59
60
61
62
63
64
65
# File 'app/values/blacklight/types.rb', line 56

def cast(input)
  value = super
  return if value.blank?

  begin
    ::Date.parse(value.to_s)
  rescue ArgumentError
    Rails.logger&.info "Unable to parse date: #{value.inspect}"
  end
end