lib/date_input.rb
def to_date
    Date.parse input
  rescue TypeError, ArgumentError
    default
  end
# Returns the parsed date from the user input or, if the input is invalid, the
# given default value
Returns the parsed date from the user input or, if the input is invalid, the
given default value
Returns the parsed date from the user input or if the input is invalid the given default value
def to_date
    Date.parse input
  rescue TypeError, ArgumentError
    default
  end
def to_date Date . parse input rescue TypeError , ArgumentError default end
Returns the parsed date from the user input or, if the input is invalid, the
given default value
Returns the parsed date from the user input or if the input is invalid the given default value