Dates.Recurring
Dates.Recurring copied to clipboard
Improvement - Method to return full list of dates between the set up dates
Small suggestion to have a method to retrieve all dates, Currently I'm doing this, not sure if it's the best
`// Weekly recurrences var weekly = Recurs .Starting(request.DateStart.DateTime) .Every(1) .Weeks() .FirstDayOfWeek(DayOfWeek.Monday) .OnDays(Day.WEDNESDAY) //TODO Move to a options object/model .Ending(request.DateEnd.DateTime) .Build();
List<DateTime> dates = new(); DateTime? prevData = request.DateStart; while ((prevData = weekly.Next(prevData.Value)).HasValue) { dates.Add(prevData.Value); }
return dates;`