No AI, just math.
DateRecurrenceR is a .NET library designed to handle and manage recurrence date patterns efficiently.
- Dynamic Subrange Generation: Generate only the needed dates within a specified range, optimizing performance and memory usage.
- Time Localization Simplification: Uses DateOnly, eliminating issues related to time localization.
- Flexible Collection Handling: Returns an enumerator, allowing developers to choose the collection type.
- Optimal Performance: Boasts a Big O notation of O(1), ensuring efficient operations.
| method | description |
|---|---|
| Daily | Gets a daily recurrence by interval |
| Weekly | Gets a weekly recurrence by days of week and interval |
| Monthly | Gets a monthly recurrence by days of week or day of month and interval |
| Yearly | Gets an yearly recurrence by days of week or day of month or day of year and interval |
All these methods return an instance of IEnumerator<DateOnly>.
| parameter | description |
|---|---|
| beginDate | The date when the recurrence begins. |
| endDate | The date when the recurrence ends. |
| interval | The interval between occurrences. |
| fromDate | The date when a specific range starts. |
| toDate | The date when a specific range finishes. |
| count | The maximum number of contiguous dates. |
| dayOfWeek | The day of the week. |
| dayOfMonth | The day of the month. Takes the last day of the month if dayOfMonth is more than the days in the month. |
| dayOfYear | The day of the year. |
| weekDays | Days of the week. |
| indexOfDay | Index of dayOfWeek in the month. |
| numberOfMonth | The number of the month. |
| firstDayOfWeek | The first day of the week. |
All methods for recurrences support the following subrange rules:
- Parameters:
fromDateandtoDate - Rule: Takes dates from the intersection
[beginDate, endDate] ∪ [fromDate, toDate]
- Parameters:
fromDateandcount - Rule: Takes dates from the intersection
[beginDate, endDate] ∪ [fromDate, DateOnly.MaxValue]and takes the firstcountdates
var enumerator = Recurrence.Daily(beginDate, endDate, fromDate, toDate, interval); // IEnumerator<DateOnly>You can install DateRecurrenceR via NuGet:
Package Manager Console:
Install-Package DateRecurrenceR.NET Core CLI:
dotnet add package DateRecurrenceR