Dim iDate As Date = EndDate
Dim iEndDate As Date = EndDate
Do Until iDate.Date = StartDate.Date
Select Case iDate.DayOfWeek
Case DayOfWeek.Monday
iEndDate.AddHours(-14)
Case DayOfWeek.Tuesday
iEndDate.AddHours(-14)
Case DayOfWeek.Wednesday
iEndDate.AddHours(-14)
Case DayOfWeek.Thursday
iEndDate.AddHours(-14)
Case DayOfWeek.Friday
iEndDate.AddHours(-14)
Case DayOfWeek.Saturday
iEndDate.AddHours(-24)
Case DayOfWeek.Sunday
iEndDate.AddHours(-24)
End Select
iDate.AddDays(-1)
Loop
dim ts as TimeSpan = iEndDate - StartDate
|