protected int getIntDayOfWeek(String dayOfWeek) throws UDFArgumentException {
    if (dayOfWeek == null) {
      return -1;
    }
    if (MON.matches(dayOfWeek)) {
      return Calendar.MONDAY;
    }
    if (TUE.matches(dayOfWeek)) {
      return Calendar.TUESDAY;
    }
    if (WED.matches(dayOfWeek)) {
      return Calendar.WEDNESDAY;
    }
    if (THU.matches(dayOfWeek)) {
      return Calendar.THURSDAY;
    }
    if (FRI.matches(dayOfWeek)) {
      return Calendar.FRIDAY;
    }
    if (SAT.matches(dayOfWeek)) {
      return Calendar.SATURDAY;
    }
    if (SUN.matches(dayOfWeek)) {
      return Calendar.SUNDAY;
    }
    return -1;
  }
GenericUDFNextDay.

Returns the first date which is later than start_date and named as indicated
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNextDay.java