Table of Contents

ObservedDateRangePolicy Enum

Definition

Namespace
Bodu.Globalization.Calendar.RangeResolution
Assembly
Bodu.Globalization.Calendar.dll
Package
Bodu.Globalization.Calendar 1.3.0
Source
ObservedDateRangePolicy.cs

Specifies which span of a resolved occurrence decides whether a date-range query includes it: the emitted span, the actual span, or either.

public enum ObservedDateRangePolicy
Extension Methods

Fields

ObservedOccurrenceControlsInclusion = 0

The emitted (observed) span controls inclusion: an occurrence is included when any day from its emitted date through its last day falls within the window. This is the default.

ActualOccurrenceControlsInclusion = 1

The actual span controls inclusion: an occurrence is included when any day from its originally calculated (actual) date through its duration falls within the window.

BothOccurrencesControlInclusion = 2

Either span controls inclusion: an occurrence is included when its emitted span or its actual span meets the window.

Remarks

The emitted span runs from Date through EndDate; the actual span runs from ActualDate through the same duration. The occurrence a query returns is always the emitted one, whichever span included it.

The policy applies to Resolve(DateRange, string) and everything built on it: the by-year and single-day queries, the working-day extensions, which under ActualOccurrenceControlsInclusion treat a moved holiday's actual day, not its observed day, as the day it makes non-working, and the caching decorator. Collision groups stay keyed by the emitted date, so an occurrence that loses its emitted day's collision is absent whichever span would include it, and the actual and observed occurrences of an ActualAndObserved policy, which share their actual date, enter and leave an actual-controlled window together.

A binary pack whose policy is not ObservedOccurrenceControlsInclusion is written at format version 3, so a reader from before the policy was applied rejects it rather than resolving it by the emitted span.

Applies to

ProductVersions
.NET8, 10

See Also