code: private int getDayIndex(int year, int month, int day) {
          Calendar cal = Calendar.getInstance();
          cal.set(year, month, day);
          return cal.get(Calendar.DAY_OF_WEEK);
      }
docs: Get DAY_OF_WEEK of a day
  
  @param year the year
  @param month the month
  @param day the day
  @return DAY_OF_WEEK of this day