1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Function IsFerie(dDate As Date) As Boolean
Dim Paques As Date, Lundi2Paques As Date, Ascension As Date
Paques = GetPaques(Year(dDate))
Lundi2Paques = Paques.AddDays(1)
Ascension = Paques.AddDays(39)
With dDate
IsFerie = .Date.Equals(Lundi2Paques) Or .Date.Equals(Ascension) _
Or (.Day = 1 And .Month = 1) Or (.Day = 1 And .Month = 5) _
Or (.Day = 8 And .Month = 5) Or (.Day = 14 And .Month = 7) _
Or (.Day = 15 And .Month = 8) Or (.Day = 1 And .Month = 11) _
Or (.Day = 11 And .Month = 11) Or (.Day = 25 And .Month = 12)
End With
End Function
Function GetPaques(Annee As Integer) As Date
Dim Y As Int16, G As Int16, C As Int16, X As Int16, Z As Int16, D As Integer, e As Integer, N As Integer, P As Integer, J As Integer, M As Integer
Y = Annee
G = (Y Mod 19) + 1
C = Int((Y / 100)) + 1
X = Int(3 * C / 4) - 12
Z = Int(((8 * C) + 5) / 25) - 5
D = Int(((5 * Y) / 4) - X - 10)
e = ((11 * G) + 20 + Z - X) Mod 30
If ((e = 25) And (G > 11)) Or (e = 24) Then e = e + 1
N = 44 - e
If N <= 21 Then N = N + 30
P = N + 7 - ((D + N) Mod 7)
If P > 31 Then
J = P - 31
Else
J = P
End If
If J = P Then
M = 3
Else
M = 4
End If
GetPaques = CDate(Str(J) + "/" + Str(M) + "/" + Str(Annee))
End Function |