Return cell and month-index (for scrolling) for a given Date.
331903
private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
    Calendar searchCal = Calendar.getInstance(timeZone, locale);
    searchCal.setTime(date);
    String monthKey = monthKey(searchCal);
    Calendar actCal = Calendar.getInstance(timeZone, locale);

    int index = cells.getIndexOfKey(monthKey);
    List<List<MonthCellDescriptor>> monthCells = cells.get(monthKey);
    for (List<MonthCellDescriptor> weekCells : monthCells) {
      for (MonthCellDescriptor actCell : weekCells) {
        actCal.setTime(actCell.getDate());
        if (sameDate(actCal, searchCal) && actCell.isSelectable()) {
          return new MonthCellWithMonthIndex(actCell, index);
        }
      }
    }
    return null;
  }
1073893
public static Temporal edate(EvaluationContext ctx, Object date, Object months) {
        Temporal dateOrDateTime = Conversions.toDateOrDateTime(date, ctx);
        int _months = Conversions.toInteger(months, ctx);
        return dateOrDateTime.plus(_months, ChronoUnit.MONTHS);
    }
538767
def monthdayscalendar(cls, year, month):
        """"""
        weeks = []
        week = []
        for day in NepCal.itermonthdays(year, month):
            week.append(day)
            if len(week) == 7:
                weeks.append(week)
                week = []
        if len(week) > 0:
            weeks.append(week)
        return weeks
87986
def fetch_chunk_data(self):
        """"""
        data = []

        counter = (relativedelta(self.end_date, self.start_date).months / 6) + 1
        months = 0

        for month in range(counter):

            chunk_start_date = self.start_date + relativedelta(months=months)
            chunk_end_date = self.start_date + relativedelta(months=months + 6)

            months += 6

            if chunk_end_date > self.end_date:
                chunk_end_date = self.end_date

            data = data + self.request.send(self.symbol, chunk_start_date, chunk_end_date)

        return data
296581
def get_month_from_date_str(date_str, lang=DEFAULT_DATE_LANG):
    
    date_str = date_str.lower()
    with calendar.different_locale(LOCALES[lang]):
        month_abbrs = list(calendar.month_abbr)
        for seq, abbr in enumerate(month_abbrs):
            if abbr and abbr.lower() in date_str:
                return seq, abbr
    return ()
355123
function toDate(date) {
  date = new Date(date)
  return months[date.getMonth()] + ' ' + date.getFullYear()
}
613701
def display_monthly_returns(self):
        
        data = [['Year', 'Jan', 'Feb', 'Mar', 'Apr', 'May',
                 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'YTD']]
        for k in self.return_table.index:
            r = self.return_table.loc[k].values
            data.append([k] + [fmtpn(x) for x in r])
        print(tabulate(data, headers='firstrow'))
1210133
def select_date(self, rows: List[Row], column: DateColumn) -> Date:
        
        dates: List[Date] = []
        for row in rows:
            cell_value = row.values[column.name]
            if isinstance(cell_value, Date):
                dates.append(cell_value)

        return dates[0] if dates else Date(-1, -1, -1)
989116
private static boolean checkDate(Calendar cal, int date, int month) {
		return cal.get(Calendar.DATE) == date && cal.get(Calendar.MONTH) == month;
	}
455218
public static int month(EvaluationContext ctx, Object date) {
        return Conversions.toDateOrDateTime(date, ctx).get(ChronoField.MONTH_OF_YEAR);
    }
223489
function(val, options){
				var names;
				var p = val.split('-');
				if(p[0] && p[1]){

					if(!options || !options.monthSelect){
						names = curCfg.date[options.monthNames] || curCfg.date.monthNames;
						p[1] = names[(p[1] * 1) - 1];
					}

					if(options && options.splitInput){
						val = [p[0] || '', p[1] || ''];
					} else if(p[1]){
						val = curCfg.date.showMonthAfterYear ? p.join(' ') : p[1]+' '+p[0];
					}
				} else if(options && options.splitInput){
					val = [p[0] || '', p[1] || ''];
				}
				return val;
			}
588651
function(date, useLongName) {
				if (useLongName) {
					return (typeof monthNames === 'function') ?
						monthNames.call(calendar, date) :
						monthNames[date.month() - calendar.minMonth];
				} else {
					return (typeof monthNamesShort === 'function') ?
						monthNamesShort.call(calendar, date) :
						monthNamesShort[date.month() - calendar.minMonth];
				}
			}
770779
def date_key(cls, month_string):
		
		month, year = month_string.split(',')
		month_ord = cls.month_ordinal[month]
		return year, month_ord
596804
def index(self, date):
        
        for (i, (start, end, ruler)) in enumerate(self.table):
            if start <= date.jd <= end:
                return i
        return None
330635
private int getMonthLength(int year, int month) {
        int days = DAYS_IN_MONTH[month];
        if (month == FEBRUARY && isLeapYear(year)) {
            days++;
        }
        return days;
    }
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
288128
def get_date_or_404(year, month, day):
    """"""
    try:
        return datetime.date(int(year), int(month), int(day))
    except ValueError:
        raise Http404