Table of Contents

IDateCalculationStrategy Interface

Definition

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

Defines the calculation contract for a single rule strategy: given a Gregorian year, produce the occurrence of the notable date in that year, if any.

public interface IDateCalculationStrategy
Extension Methods

Remarks

The engine ships a strategy per authoring shape - among them FixedDateStrategy, DayOfWeekInMonthStrategy, RelativeWeekdayInMonthStrategy, WeekdayNearDateStrategy, OffsetFromRuleStrategy, and AlgorithmDateStrategy (which dispatches to a registered INotableDateAlgorithm). A strategy is selected per rule when a document is loaded; consumers extend the catalogue through INotableDateAlgorithm rather than by implementing this interface directly.

Methods

Calculate(int, StrategyResolutionContext)

Calculates the occurrence of the notable date in the supplied Gregorian year.

DateOnly? Calculate(int year, StrategyResolutionContext context)

Parameters

year int

The Gregorian year in which to calculate the occurrence.

context StrategyResolutionContext

The resolution context used by referential strategies to resolve other rules.

Returns

DateOnly?

The calculated occurrence, or null when the strategy produces no occurrence in year (for example a 29 February rule in a non-leap year).

Applies to

ProductVersions
.NET8, 10

See Also