code: private long monthToDayOfYear(long month, boolean isLeapYear)
    {
      long day = 0;
  
      for (int i = 0; i < month && i < 12; i++) {
        day += DAYS_IN_MONTH[i];
        if (i == 1 && isLeapYear)
          day++;
      }
  
      return day;
    }
docs: Calculates the day of the year for the beginning of the month.