BinaryStudio.ClientManager.DomainModel.Infrastructure.DateTimeExtensions.GetEndOfBusinessWeek C# (CSharp) Method

GetEndOfBusinessWeek() public static method

Calculates date of last workday within the week
public static GetEndOfBusinessWeek ( this dateWithinWeek, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday ) : System.DateTime
dateWithinWeek this
weekendLength int
endOfWeek DayOfWeek
return System.DateTime
        public static DateTime GetEndOfBusinessWeek(this DateTime dateWithinWeek, int weekendLength = 2, DayOfWeek endOfWeek = DayOfWeek.Sunday)
        {
            return dateWithinWeek.GetEndOfWeek(endOfWeek).AddDays(-weekendLength);
        }