Calculates the month based on the day of the year.
764748
private void calculateMonth()
  {
    _dayOfMonth = _dayOfYear;

    for (_month = 0; _month < 12; _month++) {
      if (_month == 1 && _isLeapYear) {
        if (_dayOfMonth < 29)
          return;
        else
          _dayOfMonth -= 29;
      }
      else if (_dayOfMonth < DAYS_IN_MONTH[(int) _month])
        return;
      else
        _dayOfMonth -= DAYS_IN_MONTH[(int) _month];
    }
  }
686137
private void addMonth(int i) {
        Calendar cal = Calendar.getInstance();
        cal.set(getDisplayYear(), getDisplayMonth() - 1, 1);
        int month = cal.get(Calendar.MONTH) + 1;
        if (i > 0 && month == 12) {
            addYear(1);
        }

        if (i < 0 && month == 1) {
            addYear(-1);
        }
        cal.add(Calendar.MONTH, i);

        monthTextField.setText(String.valueOf(cal.get(Calendar.MONTH) + 1));

    }
187353
static int getMonthLength(int month, int year) {
      Integer[] newMonths = getAdjustedMonthLength(year);
      return newMonths[month].intValue();
    }
683731
private static int getMonthDays(int month, int year) {
        Integer[] newMonths = getAdjustedMonthDays(year);
        return newMonths[month].intValue();
    }
474601
public static int dayOfYear(int year, int month, int date) {
        int leapAdjust = month > 2 && isLeapYear(year) ? 1 : 0;
        return MONTH_START_TO_DOY[month - 1] + leapAdjust + date - 1;
    }
647738
private LocalDate calculateIMMMonth(final boolean requestNextIMM, final LocalDate startDate, final int month) {
        int monthOffset;
        LocalDate date = startDate;
        switch (month) {
        case MARCH:
        case JUNE:
        case SEPTEMBER:
        case DECEMBER:
            final LocalDate immDate = calculate3rdWednesday(date);
            if (requestNextIMM && !date.isBefore(immDate)) {
                date = date.plusMonths(MONTHS_IN_QUARTER);
            } else if (!requestNextIMM && !date.isAfter(immDate)) {
                date = date.minusMonths(MONTHS_IN_QUARTER);
            }
            break;

        default:
            if (requestNextIMM) {
                monthOffset = (MONTH_IN_YEAR - month) % MONTHS_IN_QUARTER;
                date = date.plusMonths(monthOffset);
            } else {
                monthOffset = month % MONTHS_IN_QUARTER;
                date = date.minusMonths(monthOffset);
            }
            break;
        }
        return date;
    }
460244
def day_of_year(date = self)
      date.month == 1 ? date.day : (DAYS_IN_YEAR[date.month - 2] + date.day)
    end
1314760
private function getDaysInMonth(Month $month, Year $year)
    {
        return (int)date('t', mktime(0, 0, 0, (string)$month, 1, (string)$year));
    }
1156293
function getDayOfMonth (date, month) {
  date = toStringDate(date)
  if (baseExports.isDate(date)) {
    return Math.floor((getDateTime(getWhatMonth(date, month, STRING_LAST)) - getDateTime(getWhatMonth(date, month, STRING_FIRST))) / DAY_TIME) + 1
  }
  return date
}
912009
def calculate_month(birth_date):
    
    year = int(birth_date.strftime('%Y'))
    month = int(birth_date.strftime('%m')) + ((int(year / 100) - 14) % 5) * 20

    return month
581630
function(year) {
			var months = Math.floor((235 * year - 234) / 19);
			var parts = 12084 + 13753 * months;
			var day = months * 29 + Math.floor(parts / 25920);
			if (mod(3 * (day + 1), 7) < 3) {
				day++;
			}
			return day;
		}
264448
protected static void setMonthDay(int monthDay, Calendar cal) {
		// monthDay = month * 32 + day;
		int month = monthDay / MONTH_MULTIPLICATOR;
		cal.set(Calendar.MONTH, month - 1);
		int day = monthDay - month * MONTH_MULTIPLICATOR;
		cal.set(Calendar.DAY_OF_MONTH, day);
	}
632596
public static function days_in_month($month, $year = null)
	{
		$year  = ! empty($year) ? (int) $year : (int) date('Y');
		$month = (int) $month;

		if ($month < 1 or $month > 12)
		{
			throw new \UnexpectedValueException('Invalid input for month given.');
		}
		elseif ($month == 2)
		{
			if ($year % 400 == 0 or ($year % 4 == 0 and $year % 100 != 0))
			{
				return 29;
			}
		}

		$days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
		return $days_in_month[$month-1];
	}
1140111
function calculateDatePos(startDayOfMonth, day) {
	const start = startDayOfMonth - 1;
	day = day - 1;
	const weekDayIndex = (start + day) % WEEKDAYS;
	const weekIndex = Math.ceil((start + day + 1) / WEEKDAYS) - 1;
	return {
		weekIndex,
		weekDayIndex
	};
}
889191
function(year, month, day) {
			if (!this._calendar.isValid(year, month, day)) {
				throw ($.calendars.local.invalidDate || $.calendars.regionalOptions[''].invalidDate).
					replace(/\{0\}/, this._calendar.local.name);
			}
			this._year = year;
			this._month = month;
			this._day = day;
			return this;
		}
772432
def _add_months(self, date, months):
        
        year = date.year + (date.month + months - 1) // 12
        month = (date.month + months - 1) % 12 + 1
        return datetime.date(year=year, month=month, day=1)
949364
function daysInMonth(date) {
  var d = new Date(date.getTime());
  d.setMonth(d.getMonth() + 1);
  d.setDate(0);

  return d.getDate();
}