Finds a month `tbody` in the calendar element given a date.
768712
function findMonthElement(element, date) {
    var months = element.querySelectorAll('[md-calendar-month-body]');
    var monthHeader = dateLocale.monthHeaderFormatter(date);
    var month;

    for (var i = 0; i < months.length; i++) {
      month = months[i];
      if (month.querySelector('tr:first-child td:first-child').textContent === monthHeader) {
        return month;
      }
    }
    return null;
  }
815038
def get_month_range(d=None):
    
    if not d:
        d = timezone.now()

    start = d.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
    end = start + relativedelta(months=1)
    return start, end
212197
function(date) {
        var start = this.findMonthStart(date);
        var nextMonth = this.add(start, this.MONTH, 1);
        var end = this.subtract(nextMonth, this.DAY, 1);
        return end;
    }
355123
function toDate(date) {
  date = new Date(date)
  return months[date.getMonth()] + ' ' + date.getFullYear()
}
214978
def get_days_in_month(year: int, month: int) -> int:
    
    month_range = calendar.monthrange(year, month)
    return month_range[1]
443802
public static Date getLastDayOfMonth(Date date){
        Calendar ca = Calendar.getInstance();
        ca.setTime(date);
        ca.set(Calendar.DAY_OF_MONTH,   1);
        Date firstDate = ca.getTime();
        return addDay(addMonth(firstDate, 1), -1);
    }
185383
def get_nameday(self, month=None, day=None):
        """"""
        if month is None:
            month = datetime.now().month
        if day is None:
            day = datetime.now().day
        return self.NAMEDAYS[month-1][day-1]
225776
void formatDayOfWeekInMonth(StringBuilder b, ZonedDateTime d, int width) {
    int day = ((d.getDayOfMonth() - 1) / 7) + 1;
    b.append(day);
  }
1309204
function(date) {
        var monthLabel  = this.Locale.LOCALE_MONTHS[date.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX,
            yearLabel = (date.getFullYear() + this.Locale.YEAR_OFFSET) + this.Locale.MY_LABEL_YEAR_SUFFIX;

        if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
            return yearLabel + monthLabel;
        } else {
            return monthLabel + yearLabel;
        }
    }
497934
private int parseMonth(String month) {
    for (int i = 0; i < months.length; i++)
      if (months[i].startsWith(month))
        return i;
    return -1;
  }
565845
def add_month(t: datetime, n: int=1) -> datetime:
    
    t2 = t
    for count in range(abs(n)):
        if n > 0:
            t2 = datetime(year=t2.year, month=t2.month, day=1) + timedelta(days=32)
        else:
            t2 = datetime(year=t2.year, month=t2.month, day=1) - timedelta(days=2)
        try:
            t2 = t.replace(year=t2.year, month=t2.month)
        except Exception:
            first, last = monthrange(t2.year, t2.month)
            t2 = t.replace(year=t2.year, month=t2.month, day=last)
    return t2
1223980
def _days_in_month(date):
    """"""
    if date.month == 12:
        reference = type(date)(date.year + 1, 1, 1)
    else:
        reference = type(date)(date.year, date.month + 1, 1)
    return (reference - timedelta(days=1)).day
104009
private static int tryParseMonth(String month, Locale locale) {
		Map<String, Integer> names = getMonthNames(locale);
		Integer r = names.get(month.toUpperCase());
		if (r != null) {
			return r;
		}
		return -1;
	}
525309
function filterMonth(arr, year, disabledDateObj) {
  const minDateTime = new Date(year, 0, 1).getTime();
  const maxDateTime = new Date(year, 11, 31).getTime();
  const monthRangeArr = getDateRangeArr(disabledDateObj, minDateTime, maxDateTime);
  const monthArr = [];
  monthRangeArr.forEach((item) => {
    let { start, end } = item;
    start = new Date(start);
    end = new Date(end);

    const monthStart = start.getMonth();
    const monthEnd = end.getMonth();
    const dayStart = start.getDate();
    const dayEnd = new Date(end.getTime() + 86400000).getDate();
    if (dayStart === 1) {
      if (dayEnd === 1) {
        for (let i = monthStart; i <= monthEnd; i++) {
          monthArr.push(i);
        }
      } else {
        for (let i = monthStart; i < monthEnd; i++) {
          monthArr.push(i);
        }
      }
    }
    if (dayEnd === 1) {
      for (let i = monthStart + 1; i <= monthEnd; i++) {
        monthArr.push(i);
      }
    } else {
      for (let i = monthStart + 1; i < monthEnd; i++) {
        monthArr.push(i);
      }
    }
  });
  return arr.filter((item) => {
    const month = item.value;
    return monthArr.indexOf(month) === -1;
  });
}
674550
def _month_converter(self, date_time):
        """"""
        if not date_time:
            date_time = datetime.datetime.utcnow()
        if isinstance(date_time, datetime.datetime):
            date_time = '%s-%02d' % (date_time.year, date_time.month)
        return date_time
989116
private static boolean checkDate(Calendar cal, int date, int month) {
		return cal.get(Calendar.DATE) == date && cal.get(Calendar.MONTH) == month;
	}
1032923
def get_month(self):
        
        year = super(BuildableMonthArchiveView, self).get_year()
        month = super(BuildableMonthArchiveView, self).get_month()
        fmt = self.get_month_format()
        return date(int(year), int(month), 1).strftime(fmt)