Table of Contents

WeekDayNum Struct

Definition

Namespace
Bodu.Globalization.Recurrence
Assembly
Bodu.Globalization.Recurrence.dll
Package
Bodu.Globalization.Recurrence 1.0.0
Source
WeekDayNum.cs

Represents a single entry in an RFC 5545 BYDAY rule part: a day of the week with an optional ordinal that selects a specific occurrence of that weekday within the frequency period.

public readonly struct WeekDayNum : IEquatable<WeekDayNum>
Implements
Inherited Members
Extension Methods

Remarks

An ordinal is only meaningful when the enclosing rule is monthly or yearly; for a weekly rule the ordinal is always zero. The textual form places the ordinal before the two-letter weekday token, so -1FR parses to an entry with an ordinal of -1 and a day of Friday.

Constructors

WeekDayNum(int, DayOfWeek)

Represents a single entry in an RFC 5545 BYDAY rule part: a day of the week with an optional ordinal that selects a specific occurrence of that weekday within the frequency period.

public WeekDayNum(int Ordinal, DayOfWeek Day)

Parameters

Ordinal int

The ordinal occurrence of Day within the period. Zero selects every occurrence; a positive value counts forward from the start of the period (for example 1 is the first) and a negative value counts backward from the end (for example -1 is the last).

Day DayOfWeek

The day of the week the entry selects.

Remarks

An ordinal is only meaningful when the enclosing rule is monthly or yearly; for a weekly rule the ordinal is always zero. The textual form places the ordinal before the two-letter weekday token, so -1FR parses to an entry with an ordinal of -1 and a day of Friday.

Properties

Day

The day of the week the entry selects.

public DayOfWeek Day { get; init; }

Property Value

DayOfWeek

IsEveryOccurrence

Gets a value indicating whether the entry selects every occurrence of Day rather than a single positional occurrence.

public bool IsEveryOccurrence { get; }

Property Value

bool

true when Ordinal is zero; otherwise false.

Ordinal

The ordinal occurrence of Day within the period. Zero selects every occurrence; a positive value counts forward from the start of the period (for example 1 is the first) and a negative value counts backward from the end (for example -1 is the last).

public int Ordinal { get; init; }

Property Value

int

Methods

Deconstruct(out int, out DayOfWeek)

public void Deconstruct(out int Ordinal, out DayOfWeek Day)

Parameters

Ordinal int
Day DayOfWeek

Equals(WeekDayNum)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(WeekDayNum other)

Parameters

other WeekDayNum

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(WeekDayNum, WeekDayNum)

public static bool operator ==(WeekDayNum left, WeekDayNum right)

Parameters

left WeekDayNum
right WeekDayNum

Returns

bool

operator !=(WeekDayNum, WeekDayNum)

public static bool operator !=(WeekDayNum left, WeekDayNum right)

Parameters

left WeekDayNum
right WeekDayNum

Returns

bool

Applies to

ProductVersions
.NET8, 10