src/Azos/DateUtils.cs
/// <summary>
/// Round date to next specific week day
/// </summary>
Round date to next specific week day
Round date to next specific week day
public static DateTime RoundToNextWeekDay(this DateTime now, DayOfWeek dayOfWeek, bool keepTime = false)
    {
      var dt = now.DayOfWeek - dayOfWeek;
      var result = now.AddDays(dt == 0 ? 7 : (7 - dt) % 7);
      return keepTime ? result : result.Date;
    }
public static DateTime RoundToNextWeekDay ( this DateTime now , DayOfWeek dayOfWeek , bool keepTime = false ) { var dt = now . DayOfWeek - dayOfWeek ; var result = now . AddDays ( dt == 0 ? 7 : ( 7 - dt ) % 7 ) ; return keepTime ? result : result . Date ; }
Round date to next specific week day
Round date to next specific week day
DateTime
this
dayOfWeek
DayOfWeek
keepTime
bool