1
Answer

Date Difference With Weekoff

Ashok K

Ashok K

6y
637
1
For my Asp.net C# website, I want to find the difference between two given dates from user, which should exclude second, fourth Saturday of the month and holidays.
 
I had stored Holiday dates in table.
 
I had used to avoid Sunday by using the following code
if (date.DayOfWeek != DayOfWeek.Sunday).
  
For example:
From Date: 30/08/2018
To Date:    03/09/2018 
I want answer like: Total Days - 3 
 
From Date:  07/09/2018
To Date:       10/09/2018
I want answer like: Total Days - 2 
Answers (1)