code: public static int calendarDay2Day(int day) {
          switch (day) {
              case Calendar.SUNDAY:
                  return SU;
              case Calendar.MONDAY:
                  return MO;
              case Calendar.TUESDAY:
                  return TU;
              case Calendar.WEDNESDAY:
                  return WE;
              case Calendar.THURSDAY:
                  return TH;
              case Calendar.FRIDAY:
                  return FR;
              case Calendar.SATURDAY:
                  return SA;
              default:
                  throw new RuntimeException("bad day of week: " + day);
          }
      }
docs: Converts one of the Calendar.SUNDAY constants to the SU, MO, etc.
  constants.  btw, I think we should switch to those here too, to
  get rid of this function, if possible.