Dates.Recurring icon indicating copy to clipboard operation
Dates.Recurring copied to clipboard

Improvement - Method to return full list of dates between the set up dates

Open ruieloi opened this issue 3 years ago • 0 comments

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;`

ruieloi avatar Oct 28 '21 10:10 ruieloi