IDateRecurrenceStrategy Interface
Definition
- Namespace
- Bodu.Globalization.Calendar.Algorithms
- Assembly
- Bodu.Globalization.Calendar.dll
- Package
- Bodu.Globalization.Calendar 1.0.1
Calculates every occurrence of a recurring notable-date pattern that falls within a bounded date range, such as every second Tuesday or the last Friday of every month.
public interface IDateRecurrenceStrategy
- Extension Methods
Remarks
A recurrence strategy is the multi-occurrence counterpart to IDateCalculationStrategy: where a single-date strategy yields at most one occurrence per year, a recurrence strategy can yield zero, one, or many occurrences within the requested window. A NotableDateRule declares exactly one occurrence source - either a single-date strategy or a recurrence strategy.
Implementations must be deterministic and independent of CurrentCulture. The returned dates must be in ascending chronological order, contain no duplicates, and fall entirely within the range passed to GetOccurrences(DateRange, StrategyResolutionContext). Generation is always bounded by the range; an implementation must never expose or produce an unbounded sequence, and whether a given date is an occurrence must not depend on the size or start of the query range (anchor-based patterns are query-window invariant).
Methods
GetOccurrences(DateRange, StrategyResolutionContext)
Calculates the occurrences of the recurrence that fall within the supplied inclusive date range.
IEnumerable<DateOnly> GetOccurrences(DateRange range, StrategyResolutionContext context)
Parameters
rangeDateRangeThe inclusive window to generate occurrences within.
contextStrategyResolutionContextThe resolution context for referential lookups.
Returns
- IEnumerable<DateOnly>
The occurrences within
rangein ascending chronological order, without duplicates; an empty sequence when the recurrence produces no occurrence in the window.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |