code: public static boolean sameMonth(Date dateOne, Date dateTwo) {
          if ((dateOne == null) || (dateTwo == null)) {
              return false;
          }
  
          Calendar cal = Calendar.getInstance();
          cal.setTime(dateOne);
          int year = cal.get(Calendar.YEAR);
          int month = cal.get(Calendar.MONTH);
  
          cal.setTime(dateTwo);
          int year2 = cal.get(Calendar.YEAR);
          int month2 = cal.get(Calendar.MONTH);
  
          return ( (year == year2) && (month == month2) );
      }
docs: Test to see if two dates are in the same month
  
  @param dateOne first date
  @param dateTwo second date
  @return true if the two dates are in the same month