code: static int invertWeekdayNum(
              WeekdayNum weekdayNum, Weekday dow0, int nDays) {
          assert weekdayNum.num < 0;
          // how many are there of that week?
          return countInPeriod(weekdayNum.wday, dow0, nDays) + weekdayNum.num + 1;
      }
docs: Compute an absolute week number given a relative one.
  The day number -1SU refers to the last Sunday, so if there are 5 Sundays
  in a period that starts on dow0 with nDays, then -1SU is 5SU.
  Depending on where its used it may refer to the last Sunday of the year
  or of the month.
  
  @param weekdayNum -1SU in the example above.
  @param dow0 the day of the week of the first day of the week or month.
  One of the RRULE_WDAY_* constants.
  @param nDays the number of days in the month or year.
  @return an abolute week number, e.g. 5 in the example above.
  Valid if in [1,53].