RecurrenceCanOccurOnHoliday Property
This is used to set or get whether or not the instances can occur on a holiday
Namespace: EWSoftware.PDIAssembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public bool CanOccurOnHoliday { get; set; }
Public Property CanOccurOnHoliday As Boolean
Get
Set
public:
property bool CanOccurOnHoliday {
bool get ();
void set (bool value);
}
member CanOccurOnHoliday : bool with get, set
Property Value
Boolean If set to false, any generated instance that matches a holiday date found in the
Holidays property will be discarded. The default is true so that instances can occur
on holiday dates.
This example shows one way to add holidays to the recurrence to prevent instances
from occurring on them.
// Create a set of fixed and floating holidays. The recurrence holiday collection
// is static.
Recurrence.Holidays.Clear();
Recurrence.Holidays.AddFixed(1, 1, true, "New Year's Day");
Recurrence.Holidays.AddFloating(DayOccurrence.Third, DayOfWeek.Monday, 1, 0,
"Martin Luther King Day");
Recurrence.Holidays.AddFloating(DayOccurrence.Third, DayOfWeek.Monday, 2, 0,
"President's Day");
Recurrence.Holidays.AddFloating(DayOccurrence.Last, DayOfWeek.Monday, 5, 0,
"Memorial Day");
Recurrence.Holidays.AddFixed(6, 19, true, "Juneteenth").MinimumYear = 2021;
Recurrence.Holidays.AddFixed(7, 4, true, "Independence Day");
Recurrence.Holidays.AddFloating(DayOccurrence.First, DayOfWeek.Monday, 9, 0,
"Labor Day");
Recurrence.Holidays.AddFixed(11, 11, true, "Veteran's Day");
Recurrence.Holidays.AddFloating(DayOccurrence.Fourth, DayOfWeek.Thursday, 11, 0,
"Thanksgiving Day");
Recurrence.Holidays.AddFloating(DayOccurrence.Fourth, DayOfWeek.Thursday, 11, 1,
"Day After Thanksgiving");
Recurrence.Holidays.AddFixed(12, 25, true, "Christmas Day");
// Create a recurrence
Recurrence rRecur = new Recurrence();
// Set it to recur daily but disallow occurrences on any of the defined holidays
rRecur.CanOccurOnHoliday = false;
rRecur.RecurDaily(1);
rRecur.MaximumOccurrences = 365;
DateTimeCollection dc = rRecur.AllInstances();
' Create a set of fixed and floating holidays. The recurrence holiday collection
' is static.
Recurrence.Holidays.Clear()
Recurrence.Holidays.AddFixed(1, 1, True, "New Year's Day")
Recurrence.Holidays.AddFloating(DayOccurrence.Third, DayOfWeek.Monday, 1, 0,
"Martin Luther King Day")
Recurrence.Holidays.AddFloating(DayOccurrence.Third, DayOfWeek.Monday, 2, 0,
"President's Day")
Recurrence.Holidays.AddFloating(DayOccurrence.Last, DayOfWeek.Monday, 5, 0,
"Memorial Day")
Recurrence.Holidays.AddFixed(6, 19, True, "Juneteenth").MinimumYear = 2021
Recurrence.Holidays.AddFixed(7, 4, True, "Independence Day")
Recurrence.Holidays.AddFloating(DayOccurrence.First, DayOfWeek.Monday, 9, 0,
"Labor Day")
Recurrence.Holidays.AddFixed(11, 11, True, "Veteran's Day")
Recurrence.Holidays.AddFloating(DayOccurrence.Fourth, DayOfWeek.Thursday, 11, 0,
"Thanksgiving Day")
Recurrence.Holidays.AddFloating(DayOccurrence.Fourth, DayOfWeek.Thursday, 11, 1,
"Day After Thanksgiving")
Recurrence.Holidays.AddFixed(12, 25, True, "Christmas Day")
' Create a recurrence
Dim rRecur As New Recurrence()
' Set it to recur daily but disallow occurrences on any of the defined holidays
rRecur.CanOccurOnHoliday = False
rRecur.RecurDaily(1)
rRecur.MaximumOccurrences = 365
Dim dc As DateTimeCollection = rRecur.AllInstances()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.