RecurringObjectLastInstance Method

This method can be used to quickly determine the end date of an item regardless of whether it uses recurrence or not.

Definition

Namespace: EWSoftware.PDI.Objects
Assembly: EWSoftware.PDI.Data (in EWSoftware.PDI.Data.dll) Version: 2023.1.2.0
public DateTime LastInstance(
	bool inLocalTime
)

Parameters

inLocalTime  Boolean
If true, the date/time is returned expressed in local time. If false, it is returned expressed in the time zone of the object as specified by the TimeZoneId property. If no time zone ID has been specified or it cannot be found, local time is used.

Return Value

DateTime
For non-recurring items, it returns the starting date plus the duration. For recurring items, it scans the recurrence rules' RecurUntil property values and the recurrence dates' DateTimeValue or it's PeriodValue's EndDateTime property values to find the highest date/time and returns that plus the duration. Note that it will not expand the recurrence rules. Exception rules and exception dates are ignored. This is useful for finding out whether or not an item may generate a date in a given range without actually expanding it completely.

See Also