Table of Contents

IDateRecurrenceStrategy Interface

Definition

Namespace
Bodu.Globalization.Calendar.Algorithms
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.0.1
Source
IDateRecurrenceStrategy.cs

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

range DateRange

The inclusive window to generate occurrences within.

context StrategyResolutionContext

The resolution context for referential lookups.

Returns

IEnumerable<DateOnly>

The occurrences within range in ascending chronological order, without duplicates; an empty sequence when the recurrence produces no occurrence in the window.

Applies to

ProductVersions
.NET8, 10

See Also