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
OrdinalintThe ordinal occurrence of
Daywithin the period. Zero selects every occurrence; a positive value counts forward from the start of the period (for example1is the first) and a negative value counts backward from the end (for example-1is the last).DayDayOfWeekThe 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
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
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
Methods
Deconstruct(out int, out DayOfWeek)
public void Deconstruct(out int Ordinal, out DayOfWeek Day)
Parameters
Equals(WeekDayNum)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(WeekDayNum other)
Parameters
otherWeekDayNumAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
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
leftWeekDayNumrightWeekDayNum
Returns
operator !=(WeekDayNum, WeekDayNum)
public static bool operator !=(WeekDayNum left, WeekDayNum right)
Parameters
leftWeekDayNumrightWeekDayNum
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |