CSharp examples for System:DateTime Week
Get Days Of Week After
using Windows.Globalization.DateTimeFormatting; using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from w w w .j a va 2s.c o m*/ public class Main{ public static IEnumerable<DateTime> GetDaysOfWeekAfter(this DateTime dateTime, uint days = 6, uint daysToSkip = 1, bool wrap = false) { var daysOfWeek = new List<DateTime>((int)days); for (uint i = daysToSkip; i < days + daysToSkip; i++) { var newDateTime = dateTime.AddDays(i); if (wrap == false && dateTime.DayOfWeek == newDateTime.DayOfWeek) { break; } daysOfWeek.Add(newDateTime); } return daysOfWeek; } }