public override bool Includes(DateTime aDate) { var quarterMonthArray = BuildMonthQuarterMatrix(); int ourMonth = (int)quarterMonthArray.GetValue(_quarter, _quarterInterval) + 1; // since our months are zero-based if (aDate.Month == ourMonth) { // we have a match on Month! Now just need to check day ... return(TEHelpers.DayOfWeekMatches(aDate, _dayOfWeek) && TEHelpers.WeekMatches(aDate, _monthInterval)); } return(false); }
/// <summary> /// Returns true if the date falls on a holiday /// </summary> /// <param name="aDate"></param> /// <returns></returns> public override bool Includes(DateTime aDate) { return(MonthMatches(aDate) && TEHelpers.DayOfWeekMatches(aDate, _dayOfWeek) && TEHelpers.WeekMatches(aDate, _monthlyInterval)); }
public override bool Includes(DateTime aDate) { if (_monthIntervalType == eMonthIntervalType.EachWeekSelectedWeekDays) { return(IntervalMatches(aDate) && TEHelpers.DayOfWeekMatches(aDate, _dayOfWeek)); } else if (_monthIntervalType == eMonthIntervalType.SelectedDate) { return(IntervalMatches(aDate) && TEHelpers.DayMatches(aDate, _date)); } else { return(IntervalMatches(aDate) && TEHelpers.DayOfWeekMatches(aDate, _dayOfWeek) && TEHelpers.WeekMatches(aDate, _monthlyInterval)); } }