- <%
- '//---------------------------------------------------------------------------
- '// CALCULE la date de fin et Enlève les jours des week-ends
- '//---------------------------------------------------------------------------
- dim cpte
- Function CalculDateFin(DateD, duree)
-
- Dim NbJourWE
- Dim DateC, DateFin
-
- '//Cas de la durée non entière : ex. 2,5 jours
- If (CStr(duree) > CStr(Int(duree))) Then
- duree = duree + 1
- End If
-
- DateC = DateD
- DateFin = DateAdd("d", Int(duree), DateC)
- If (cpte = 0) Then
- DateFin = DateAdd("d", duree - 1, DateC)
- Else
- If (DatePart("w", DateC) = 1 Or DatePart("w", DateC) = 7) Then
- DateC = DateAdd("d", 1, DateC)
- End If
- End If
-
- cpte = cpte + 1
- While (CDate(DateC) <= DateFin)
-
- If (DatePart("w", DateC) = 1 Or DatePart("w", DateC) = 7) Then
- NbJourWE = NbJourWE + 1
- End If
- DateC = DateAdd("d", 1, DateC)
-
-
- Wend
- If (NbJourWE > 0) Then
- DateFin = CalculDateFin(DateFin, NbJourWE)
- NbJourWE = 0
- End If
- cpte = 0
- CalculDateFin = DateFin
-
-
- End Function
- %>
<%
'//---------------------------------------------------------------------------
'// CALCULE la date de fin et Enlève les jours des week-ends
'//---------------------------------------------------------------------------
dim cpte
Function CalculDateFin(DateD, duree)
Dim NbJourWE
Dim DateC, DateFin
'//Cas de la durée non entière : ex. 2,5 jours
If (CStr(duree) > CStr(Int(duree))) Then
duree = duree + 1
End If
DateC = DateD
DateFin = DateAdd("d", Int(duree), DateC)
If (cpte = 0) Then
DateFin = DateAdd("d", duree - 1, DateC)
Else
If (DatePart("w", DateC) = 1 Or DatePart("w", DateC) = 7) Then
DateC = DateAdd("d", 1, DateC)
End If
End If
cpte = cpte + 1
While (CDate(DateC) <= DateFin)
If (DatePart("w", DateC) = 1 Or DatePart("w", DateC) = 7) Then
NbJourWE = NbJourWE + 1
End If
DateC = DateAdd("d", 1, DateC)
Wend
If (NbJourWE > 0) Then
DateFin = CalculDateFin(DateFin, NbJourWE)
NbJourWE = 0
End If
cpte = 0
CalculDateFin = DateFin
End Function
%>