1
Vote

IsBusinessDay not working on sunday

description

The IsBusinessDay function gives me "true" on sundays. (CRM 2013 on premise)

The source code:
         bool validBusinessDay = dateToCheck.DayOfWeek != DayOfWeek.Saturday || dateToCheck.DayOfWeek == DayOfWeek.Sunday;

should probably be changed to:
            bool validBusinessDay = (dateToCheck.DayOfWeek != DayOfWeek.Saturday) && (dateToCheck.DayOfWeek != DayOfWeek.Sunday);

comments