code: function(year, monthIndex) {
          if (year.year) {
              year = year.year();
              monthIndex = year.month();
          }
  
          // compute intercalary month in the year (0 if none)
          var intercalaryMonth = this.intercalaryMonth(year);
  
          // validate month
          var maxMonthIndex = (intercalaryMonth) ? 12 : 11;
          if (monthIndex < 0 || monthIndex > maxMonthIndex) {
              throw main.local.invalidMonth
                  .replace(/\{0\}/, this.local.name);
          }
  
          // compute Chinese month
          var month;
  
          if (!intercalaryMonth) {
              month = monthIndex + 1;
          } else if(monthIndex < intercalaryMonth) {
              month = monthIndex + 1;
          } else {
              month = monthIndex;
          }
  
          return month;
      }
docs: Retrieve the month (i.e. accounting for intercalary months).
  @memberof ChineseCalendar
  @param year {CDate|number} The date or the year to examine.
  @param monthIndex {number} The month index (0 for first month).
  @return {number} The month (1 for first month).
  @throws Error if an invalid month/year or a different calendar used.