/*GregYearProto.days = HebcalProto.days;
GregYearProto[map] = HebcalProto[map];
GregYearProto.filter = HebcalProto.filter;

GregYearProto.addHoliday = HebcalProto.addHoliday;
325221
function GregMonth(month, year) {
	var me = this;
	if (typeof month == 'string') {
		month = greg.lookupMonthNum(month);
	}
	if (typeof month != 'number') {
		throw new TE('month to Hebcal.GregMonth is not a valid type');
	}
	if (typeof year != 'number') {
		throw new TE('year to Hebcal.GregMonth is not a number');
	}

	me.year = year;
	me.month = month;

	me.days = c.range(1, greg.daysInMonth(month, year))[map](function(i){
		var d = new HDate(new Date(year, month - 1, i));
		defProp(d, '__gregmonth', {
			configurable: true,
			writable: true,
			value: me
		});
		return d;
	});

	me[length] = me.days[length];

	me.hebmonths = [
		{month: me[getDay]( 1)[getMonth](), year: me[getDay]( 1)[getFullYear]()},
		{month: me[getDay](-1)[getMonth](), year: me[getDay](-1)[getFullYear]()}
	].filter(function(val, i, arr){
		return i === 0 || val.month != arr[0].month;
	});

	defProp(me, 'il', getset(function(){
		return me[getDay](1).il;
	}, function(il){
		me.days.forEach(function(d){
			d.il = il;
		});
	}));

	defProp(me, 'lat', getset(function(){
		return me[getDay](1).lat;
	}, function(lat){
		me.days.forEach(function(d){
			d.lat = lat;
		});
	}));
	defProp(me, 'long', getset(function(){
		return me[getDay](1).long;
	}, function(lon){
		me.days.forEach(function(d){
			d.long = lon;
		});
	}));

	return me;
}
1275428
function filterDay(arr, year, month, disabledDateObj) {
  const minDateTime = new Date(year, month, 1).getTime();
  const maxDateTime = new Date(year, month + 1, 0).getTime();
  const dayRangeArr = getDateRangeArr(disabledDateObj, minDateTime, maxDateTime);
  const dayArr = [];
  dayRangeArr.forEach((item) => {
    let { start, end } = item;
    start = new Date(start).getDate();
    end = new Date(end).getDate();
    for (let i = start; i <= end; i++) {
      dayArr.push(i);
    }
  });
  return arr.filter((item) => {
    const day = item.value;
    return dayArr.indexOf(day) === -1;
  });
}
1004586
private void addEntryToResult(Map<LocalDate, List<Entry<?>>> result, Entry<?> entry, LocalDate startDate, LocalDate endDate) {
        LocalDate entryStartDate = entry.getStartDate();
        LocalDate entryEndDate = entry.getEndDate();

        // entry does not intersect with time interval
        if (entryEndDate.isBefore(startDate) || entryStartDate.isAfter(endDate)) {
            return;
        }

        if (entryStartDate.isAfter(startDate)) {
            startDate = entryStartDate;
        }

        if (entryEndDate.isBefore(endDate)) {
            endDate = entryEndDate;
        }

        LocalDate date = startDate;
        do {
            result.computeIfAbsent(date, it -> new ArrayList<>()).add(entry);
            date = date.plusDays(1);
        } while (!date.isAfter(endDate));
    }
927099
public static <T> void addAll(Collection<T> pagingResults, Collection<T> paging, BooleanExpression<T> filter)
	{
		if (pagingResults == null || paging == null)
			return;

		if (filter != null)
		{
			for (T obj : paging)
			{
				if (filter.apply(obj))
					pagingResults.add(obj);
			}
		}
		else
		{
			// add independent of a filter
			for (T obj : paging)
			{
				pagingResults.add(obj);
			}
		}
	}
156635
void formatDayOfYear(StringBuilder b, ZonedDateTime d, int width) {
    int day = d.getDayOfYear();
    int digits = day < 10 ? 1 : day < 100 ? 2 : 3;
    switch (digits) {
      case 1:
        if (width > 1) {
          b.append('0');
        }
        // fall through

      case 2:
        if (width > 2) {
          b.append('0');
        }
        // fall through

      case 3:
        b.append(day);
        break;
    }
  }
489386
private long yearToDayOfEpoch(long year)
  {
    if (year > 0) {
      year -= 1601;
      return (365 * year + year / 4 - year / 100 + year / 400 -
              ((1970 - 1601) * 365 + (1970 - 1601) / 4 - 3));
    } else {
      year = 2000 - year;

      return ((2000 - 1970) * 365 + (2000 - 1970) / 4 -
              (365 * year + year / 4 - year / 100 + year / 400));
    }
  }
894118
public static Date addYear(String date, int amount) throws ParseException {
        return add(date, Calendar.YEAR, amount);
    }
1117774
private static Map<String, Integer> daysOfWeekMapping() {
        final Map<String, Integer> stringMapping = new HashMap<>();
        stringMapping.put("MON", 1);
        stringMapping.put("TUE", 2);
        stringMapping.put("WED", 3);
        stringMapping.put("THU", 4);
        stringMapping.put("FRI", 5);
        stringMapping.put("SAT", 6);
        stringMapping.put("SUN", 7);
        return stringMapping;
    }
1116547
public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
1252585
function(daysSinceHebrewBase) {
    var parts, months, year;
    parts = daysSinceHebrewBase * DAY_LENGTH;
    months = parts / MONTH_LENGTH;
    months = Math.floor(months);
    year = months2year(months);
    months = year2months(year);
    return months;
  }
945354
private void addYear(int i) {
        Calendar cal = Calendar.getInstance();
        cal.set(getDisplayYear(), 1, 1);
        cal.add(Calendar.YEAR, i);
        yearTextField.setText(String.valueOf(cal.get(Calendar.YEAR)));
    }
241927
private Date addDays(final Date date, final int days) {
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, days); //minus number would decrement the days
        return cal.getTime();
    }
779803
public void setDaysExcluded (final boolean [] days)
  {
    if (days == null)
    {
      throw new IllegalArgumentException ("The days parameter cannot be null.");
    }

    if (days.length < MAX_DAYS_IN_MONTH)
    {
      throw new IllegalArgumentException ("The days parameter must have a length of at least " +
                                          MAX_DAYS_IN_MONTH +
                                          " elements.");
    }

    m_aExcludeDays = days;
    m_aExcludeAll = areAllDaysExcluded ();
  }
989802
@Override
    public DateCalculator<LocalDate> moveByDays(final int days) {
        setCurrentIncrement(days);

        setCurrentBusinessDate(getCurrentBusinessDate().plusDays(days));

        if (getHolidayHandler() != null) {
            setCurrentBusinessDate(getHolidayHandler().moveCurrentDate(this));
        }

        return this;
    }
243100
def addYears(date, years):
    
    # map from Qt information
    if type(date).__name__ in ('QDate', 'QDateTime', 'QTime'):
        date = date.toPython()

    return datetime.date(date.year + years, date.month, date.day)
719160
@Override
    public final HolidayCalendar<E> setHolidays(final Set<E> holidays) {

        if (holidays == null) {
            this.holidays = Collections.emptyMap();
            return this;
        }

        final Map<String, E> newSet = new TreeMap<>();
        for (final E e : holidays) {
            newSet.put(toString(e), e);
        }
        this.holidays = Collections.unmodifiableMap(newSet);
        return this;
    }
813445
@Override
  public HolidayMap getHolidays (final int nYear, @Nullable final String... aArgs)
  {
    final HolidayMap aHolidays = super.getHolidays (nYear, aArgs);
    final HolidayMap aAdditionalHolidays = new HolidayMap ();
    for (final Map.Entry <LocalDate, ISingleHoliday> aEntry : aHolidays.getMap ().entrySet ())
    {
      final LocalDate aTwoDaysLater = aEntry.getKey ().plusDays (2);
      if (aHolidays.containsHolidayForDate (aTwoDaysLater))
      {
        final LocalDate aBridgingDate = aTwoDaysLater.minusDays (1);
        aAdditionalHolidays.add (aBridgingDate,
                                 new ResourceBundleHoliday (EHolidayType.OFFICIAL_HOLIDAY,
                                                            BRIDGING_HOLIDAY_PROPERTIES_KEY));
      }
    }
    aHolidays.addAll (aAdditionalHolidays);
    return aHolidays;
  }