module ApplicationHelper
  def date_format(datetime_string)
    begin
      Date.parse(datetime_string).strftime("%d-%m-%Y")
    rescue ArgumentError
      ''
    end
  end
end

module ApplicationHelper
  def date_format(datetime_string)
    begin
      Date.parse(datetime_string).strftime("%d-%m-%Y")
    rescue ArgumentError
      datetime_string
    end
  end
end

Return value as it is if not a date
Return value as it is if not a date
