# File lib/vpim/date.rb, line 44
  def Date.str2wday(wdaystr)
    return wdaystr unless wdaystr.respond_to? :to_str

    str = wdaystr.to_str.upcase
    if str.length < 2
      raise ArgumentError, 'wday #{wday} is not long enough to be a unique weekday name'
    end

    wday = Date::DAYNAMES.map { |n| n.slice(0, str.length).upcase }.index(str)

    return wday if wday

    raise ArgumentError, 'wday #{wdaystr} was not a recognizable weekday name'
  end