RecurrenceRuleExtensions Class

public static class RecurrenceRuleExtensions

No documentation is available.

Methods

NameDescription
GetNextOccurrence(IRecurrenceRule, DateTime)Gets the next occurrence of the recurrence starting from the specified date.
GetNextOccurrence(IRecurrenceRule, DateTime, string)Gets the next occurrence of the recurrence, reading startDate as a wall-clock time in the specified time zone.
GetNextOccurrence(IRecurrenceRule, DateTime, TimeZoneInfo)Gets the next occurrence of the recurrence, reading startDate as a wall-clock time in timeZone.
GetNextOccurrence(IRecurrenceRule, DateTimeOffset)Gets the next occurrence of the recurrence starting from the specified date.
GetNextOccurrence(IRecurrenceRule, DateTimeOffset, string)Gets the next occurrence of the recurrence, starting from the instant startDate denotes.
GetNextOccurrence(IRecurrenceRule, DateTimeOffset, TimeZoneInfo)Gets the next occurrence of the recurrence, starting from the instant startDate denotes.
GetNextOccurrences(IRecurrenceRule, DateTime, string)Gets all occurrences of the recurrence, reading startDate as a wall-clock time in the specified time zone.
GetNextOccurrences(IRecurrenceRule, DateTime, TimeZoneInfo)Gets all occurrences of the recurrence, reading startDate as a wall-clock time in timeZone.
GetNextOccurrences(IRecurrenceRule, DateTimeOffset, string)Gets all occurrences of the recurrence, starting from the instant startDate denotes.
GetNextOccurrences(IRecurrenceRule, DateTimeOffset, TimeZoneInfo)Gets all occurrences of the recurrence, starting from the instant startDate denotes.

GetNextOccurrence overloads

GetNextOccurrence(IRecurrenceRule, DateTime)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence starting from the specified date.

public static DateTime? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTime startDate)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTime
The date to start searching for the next occurrence.
Returns

DateTime? The next occurrence date, or null if there are no more occurrences.

GetNextOccurrence(IRecurrenceRule, DateTime, string)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence, reading startDate as a wall-clock time in the specified time zone.

public static DateTimeOffset? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTime startDate, string timeZoneId)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTime
The wall-clock time to start searching from. Its DateTime.Kind is ignored.
timeZoneId string
The identifier of the time zone the recurrence is expressed in.
Returns

DateTimeOffset? The next occurrence with the UTC offset in effect at that occurrence, or null if there are no more occurrences.

Exceptions
TimeZoneNotFoundException
No time zone matches timeZoneId.
Remarks

On .NET Framework the runtime provides no conversion between IANA and Windows identifiers, so an IANA identifier such as America/New_York does not resolve on Windows. Resolve the TimeZoneInfo there and use the overload that takes one.

GetNextOccurrence(IRecurrenceRule, DateTime, TimeZoneInfo)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence, reading startDate as a wall-clock time in timeZone.

public static DateTimeOffset? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTime startDate, TimeZoneInfo timeZone)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTime
The wall-clock time to start searching from. Its DateTime.Kind is ignored.
timeZone TimeZoneInfo
The time zone the recurrence is expressed in.
Returns

DateTimeOffset? The next occurrence with the UTC offset in effect at that occurrence, or null if there are no more occurrences.

GetNextOccurrence(IRecurrenceRule, DateTimeOffset)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence starting from the specified date.

public static DateTimeOffset? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTimeOffset startDate)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTimeOffset
The date to start searching for the next occurrence.
Returns

DateTimeOffset? The next occurrence date with the same offset as startDate, or null if there are no more occurrences.

Remarks

The occurrences are computed using the local time of startDate, and the offset of startDate is applied to the result. The offset is therefore the same for every occurrence; use an overload that takes a TimeZoneInfo to follow daylight saving transitions. A UTC or local RecurrenceRule.EndDate denotes an instant and bounds the occurrences by instant.

GetNextOccurrence(IRecurrenceRule, DateTimeOffset, string)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence, starting from the instant startDate denotes.

public static DateTimeOffset? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTimeOffset startDate, string timeZoneId)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTimeOffset
The instant to start searching from. It is reduced to a wall-clock time in the specified time zone.
timeZoneId string
The identifier of the time zone the recurrence is expressed in.
Returns

DateTimeOffset? The next occurrence with the UTC offset in effect at that occurrence, or null if there are no more occurrences.

Exceptions
TimeZoneNotFoundException
No time zone matches timeZoneId.
Remarks

On .NET Framework the runtime provides no conversion between IANA and Windows identifiers, so an IANA identifier such as America/New_York does not resolve on Windows. Resolve the TimeZoneInfo there and use the overload that takes one.

GetNextOccurrence(IRecurrenceRule, DateTimeOffset, TimeZoneInfo)

RecurrenceRuleExtensions.cs

Gets the next occurrence of the recurrence, starting from the instant startDate denotes.

public static DateTimeOffset? GetNextOccurrence(this IRecurrenceRule recurrenceRule, DateTimeOffset startDate, TimeZoneInfo timeZone)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTimeOffset
The instant to start searching from. It is reduced to a wall-clock time in timeZone.
timeZone TimeZoneInfo
The time zone the recurrence is expressed in.
Returns

DateTimeOffset? The next occurrence with the UTC offset in effect at that occurrence, or null if there are no more occurrences.

GetNextOccurrences overloads

GetNextOccurrences(IRecurrenceRule, DateTime, string)

RecurrenceRuleExtensions.cs

Gets all occurrences of the recurrence, reading startDate as a wall-clock time in the specified time zone.

public static IEnumerable<DateTimeOffset> GetNextOccurrences(this IRecurrenceRule recurrenceRule, DateTime startDate, string timeZoneId)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTime
The wall-clock time to start generating occurrences from. Its DateTime.Kind is ignored.
timeZoneId string
The identifier of the time zone the recurrence is expressed in.
Returns

IEnumerable<DateTimeOffset> An enumerable sequence of occurrences, each carrying the UTC offset in effect at that occurrence.

Exceptions
TimeZoneNotFoundException
No time zone matches timeZoneId.
Remarks

On .NET Framework the runtime provides no conversion between IANA and Windows identifiers, so an IANA identifier such as America/New_York does not resolve on Windows. Resolve the TimeZoneInfo there and use the overload that takes one.

GetNextOccurrences(IRecurrenceRule, DateTime, TimeZoneInfo)

RecurrenceRuleExtensions.cs

Gets all occurrences of the recurrence, reading startDate as a wall-clock time in timeZone.

public static IEnumerable<DateTimeOffset> GetNextOccurrences(this IRecurrenceRule recurrenceRule, DateTime startDate, TimeZoneInfo timeZone)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTime
The wall-clock time to start generating occurrences from. Its DateTime.Kind is ignored.
timeZone TimeZoneInfo
The time zone the recurrence is expressed in.
Returns

IEnumerable<DateTimeOffset> An enumerable sequence of occurrences, each carrying the UTC offset in effect at that occurrence.

GetNextOccurrences(IRecurrenceRule, DateTimeOffset, string)

RecurrenceRuleExtensions.cs

Gets all occurrences of the recurrence, starting from the instant startDate denotes.

public static IEnumerable<DateTimeOffset> GetNextOccurrences(this IRecurrenceRule recurrenceRule, DateTimeOffset startDate, string timeZoneId)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTimeOffset
The instant to start generating occurrences from. It is reduced to a wall-clock time in the specified time zone.
timeZoneId string
The identifier of the time zone the recurrence is expressed in.
Returns

IEnumerable<DateTimeOffset> An enumerable sequence of occurrences, each carrying the UTC offset in effect at that occurrence.

Exceptions
TimeZoneNotFoundException
No time zone matches timeZoneId.
Remarks

On .NET Framework the runtime provides no conversion between IANA and Windows identifiers, so an IANA identifier such as America/New_York does not resolve on Windows. Resolve the TimeZoneInfo there and use the overload that takes one.

GetNextOccurrences(IRecurrenceRule, DateTimeOffset, TimeZoneInfo)

RecurrenceRuleExtensions.cs

Gets all occurrences of the recurrence, starting from the instant startDate denotes.

public static IEnumerable<DateTimeOffset> GetNextOccurrences(this IRecurrenceRule recurrenceRule, DateTimeOffset startDate, TimeZoneInfo timeZone)
Parameters
recurrenceRule IRecurrenceRule
startDate DateTimeOffset
The instant to start generating occurrences from. It is reduced to a wall-clock time in timeZone.
timeZone TimeZoneInfo
The time zone the recurrence is expressed in.
Returns

IEnumerable<DateTimeOffset> An enumerable sequence of occurrences, each carrying the UTC offset in effect at that occurrence.

Remarks

No occurrence before startDate is returned, even when the wall-clock time it is reduced to is in the hour repeated by a backward transition, whose first reading is what RFC 5545 section 3.3.5 means.