def format_date(date, format)
      date = datetime(date)
        if format.nil? || format.empty? || format == "ordinal"
          date_formatted = ordinalize(date)
        else
          format.gsub!(/%a/, ABBR_DAYNAMES_DE[date.wday])
          format.gsub!(/%A/, DAYNAMES_DE[date.wday])
          format.gsub!(/%b/, ABBR_MONTHNAMES_DE[date.mon])
          format.gsub!(/%B/, MONTHNAMES_DE[date.mon])
          date_formatted = date.strftime(format)
        end
        date_formatted
    end
def format_date(date, format)
      date = datetime(date)
        if format.nil? || format.empty? || format == "ordinal"
          date_formatted = ordinalize(date)
        else
          format.gsub!(/%a/, ABBR_DAYNAMES_DE[date.wday])
          format.gsub!(/%A/, DAYNAMES_DE[date.wday])
          format.gsub!(/%b/, ABBR_MONTHNAMES_DE[date.mon])
          format.gsub!(/%B/, MONTHNAMES_DE[date.mon])
          date_formatted = date.strftime(format)
        end
        date_formatted
    end
Formats date by given date format