Moves a date if there are any moving conditions for this holiday and any of
them fit.

@param aMoveableHoliday
Date
@param aFixed
Optional fixed date
@return the moved date
425369
protected static final LocalDate moveDate (final MoveableHoliday aMoveableHoliday, final LocalDate aFixed)
  {
    for (final MovingCondition aMoveCond : aMoveableHoliday.getMovingCondition ())
      if (shallBeMoved (aFixed, aMoveCond))
        return _moveDate (aMoveCond, aFixed);
    return aFixed;
  }
191924
@Override
    public ThaiSolarCalendar move(
        CalendarControl<ThaiSolarCalendar> control,
        int direction
    ) {
        ThaiSolarCalendar date = control.pageDateProperty().getValue();
        ThaiSolarCalendar result;

        switch (control.viewIndexProperty().get()) {
            case NavigationBar.MONTH_VIEW:
                result = date.plus(direction, CalendarUnit.MONTHS);
                break;
            case NavigationBar.YEAR_VIEW:
                // don't miss 2483 BE under certain circumstances
                if (date.getMonth().getValue() <= 3) {
                    if (date.getYear() == 2482 && direction > 0) {
                        date = date.with(DAY_OF_YEAR, 1);
                    } else if (date.getYear() == 2484 && direction < 0) {
                        date = date.with(DAY_OF_YEAR.maximized());
                    }
                }
                result = date.plus(direction, CalendarUnit.YEARS);
                break;
            case NavigationBar.BIRD_VIEW:
                result = date.plus(Math.multiplyExact(direction, 10), CalendarUnit.YEARS);
                break;
            default:
                throw new IllegalStateException("Invalid view: " + control.viewIndexProperty().getValue());
        }

        return result;
    }
699154
func (c *Calendar) IsHoliday(date time.Time) bool {
	idx := date.Month()
	for i := range c.holidays[idx] {
		if c.holidays[idx][i].matches(date) {
			return true
		}
	}
	for i := range c.holidays[0] {
		if c.holidays[0][i].matches(date) {
			return true
		}
	}
	return false
}
1065855
private static boolean isHoliday(Calendar cal) {
		int year = cal.get(Calendar.YEAR);
		Set<?> yearSet = getHolidaySet(year);
		for (Object aYearSet : yearSet) {
			Date date = (Date) aYearSet;
			if (checkDate(cal, dateToCalendar(date))) {
				return true;
			}
		}
		return false;
	}
1336595
public int setDateTime(java.util.Date date, boolean bDisplayOption, int moveMode)
    {
        if (date != null)
        {
            m_calendar.setTime(date);
            m_calendar.set(Calendar.YEAR, DBConstants.FIRST_YEAR);
            m_calendar.set(Calendar.MONTH, Calendar.JANUARY);
            m_calendar.set(Calendar.DATE, 1);
            date = m_calendar.getTime();
            return this.setValue(date.getTime(), bDisplayOption, moveMode);
        }
        else
            return this.setData(null, bDisplayOption, moveMode);
    }
1142195
public int setCalendar(Calendar value, boolean bDisplayOption, int moveMode)
    {           // Set this field's value
        if (value != null)
        {
            value.set(Calendar.YEAR, DBConstants.FIRST_YEAR);
            value.set(Calendar.MONTH, Calendar.JANUARY);
            value.set(Calendar.DATE, 1);
        }
        return super.setCalendar(value, bDisplayOption, moveMode);
    }
924337
public void seekToHolidayYear(String holidayString, String yearString) {
    Holiday holiday = Holiday.valueOf(holidayString);
    assert(holiday != null);
    
    seekToIcsEventYear(HOLIDAY_ICS_FILE, yearString, holiday.getSummary());
  }
666565
public function addHolidays($holidays)
    {
        foreach ($holidays as $holiday) {
            if ($holiday instanceof DateRange) {
                $this->addHolidays($holiday);

                continue;
            }

            $this->addHoliday($holiday);
        }
    }
589539
public WeeklyAutoScalingSchedule withWednesday(java.util.Map<String, String> wednesday) {
        setWednesday(wednesday);
        return this;
    }
1162304
public String convertToReadableDate(Holiday holiday) {
        DateTimeFormatter parser = ISODateTimeFormat.date();

        if (holiday.isInDateForm()) {
            String month = Integer.toString(holiday.getMonth()).length() < 2
                ? "0" + holiday.getMonth() : Integer.toString(holiday.getMonth());
            String day = Integer.toString(holiday.getDayOfMonth()).length() < 2
                ? "0" + holiday.getDayOfMonth() : Integer.toString(holiday.getDayOfMonth());
            return holiday.getYear() + "-" + month + "-" + day;
        } else {
            /*
             * 5 denotes the final occurrence of the day in the month. Need to find actual
             * number of occurrences
             */
            if (holiday.getOccurrence() == 5) {
                holiday.setOccurrence(numOccurrences(holiday.getYear(), holiday.getMonth(),
                    holiday.getDayOfWeek()));
            }

            DateTime date = parser.parseDateTime(holiday.getYear() + "-"
                + holiday.getMonth() + "-" + "01");
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date.toDate());
            int count = 0;

            while (count < holiday.getOccurrence()) {
                if (calendar.get(Calendar.DAY_OF_WEEK) == holiday.getDayOfWeek()) {
                    count++;
                    if (count == holiday.getOccurrence()) {
                        break;
                    }
                }
                date = date.plusDays(1);
                calendar.setTime(date.toDate());
            }
            return date.toString().substring(0, 10);
        }
    }
221811
protected static final boolean isValid (final Holiday aHoliday, final int nYear)
  {
    return _isValidInYear (aHoliday, nYear) && _isValidForCycle (aHoliday, nYear);
  }
1250870
private static Date rollGetDate(Calendar calendar, int days) {
		Calendar easterSunday = (Calendar) calendar.clone();
		easterSunday.add(Calendar.DATE, days);
		return easterSunday.getTime();
	}
338674
public static boolean handleIfUnmodifiedSince(final HttpServerExchange exchange, final Date lastModified) {
        return handleIfUnmodifiedSince(exchange.getRequestHeaders().getFirst(Headers.IF_UNMODIFIED_SINCE), lastModified);
    }
577053
public JobScheduleDisableHeaders withLastModified(DateTime lastModified) {
        if (lastModified == null) {
            this.lastModified = null;
        } else {
            this.lastModified = new DateTimeRfc1123(lastModified);
        }
        return this;
    }
936207
def is_holiday(self, date, division=None):
        
        return date in (holiday['date'] for holiday in self.get_holidays(division=division))
1179765
public void addFloatingDate(ICalProperty property, ICalDate date) {
		floatingDates.add(new TimezonedDate(date, property));
	}
321633
def move_if_not_on_dow(original, replacement, dow_not_orig, dow_replacement):
    
    return lambda x: (
        (x.hdate.day == original and x.gdate.weekday() != dow_not_orig) or
        (x.hdate.day == replacement and x.gdate.weekday() == dow_replacement))