- Function BooJourFerie(ByVal Jour As Date) As Boolean
- Dim JJ, AA, MM As Integer
- Dim NbOr, Epacte As Integer
- Dim PLune, Paques, Ascension, Pentecote As Date
-
- JJ = Microsoft.VisualBasic.Day(Jour)
- MM = Month(Jour)
- AA = Year(Jour)
-
- If JJ = 1 And MM = 1 Then BooJourFerie = True : Exit Function '1 Janvier
- If JJ = 1 And MM = 5 Then BooJourFerie = True : Exit Function '1 Mai
- If JJ = 8 And MM = 5 Then BooJourFerie = True : Exit Function '8 Mai
- If JJ = 14 And MM = 7 Then BooJourFerie = True : Exit Function '14 Juillet
- If JJ = 15 And MM = 8 Then BooJourFerie = True : Exit Function '15 Août
- If JJ = 1 And MM = 11 Then BooJourFerie = True : Exit Function '1 Novembre
- If JJ = 11 And MM = 11 Then BooJourFerie = True : Exit Function '11 Novembre
- If JJ = 25 And MM = 12 Then BooJourFerie = True : Exit Function '25 Décembre
-
- NbOr = (AA Mod 19) + 1
- Epacte = CType((11 * NbOr - (3 + Int((2 + Int(AA / 100)) * 3 / 7))) Mod 30, Integer)
- PLune = CDate("19/04/" & AA)
- PLune = PLune.AddDays(-((Epacte + 6) Mod 30))
- If Epacte = 24 Then PLune = PLune.AddDays(-1)
- If Epacte = 25 And (AA >= 1900 And AA < 2000) Then PLune = PLune.AddDays(-1)
-
- Paques = PLune.AddDays(-Weekday(PLune) + vbMonday + 7) 'Paques
- If JJ = Microsoft.VisualBasic.Day(Paques) And MM = Month(Paques) Then BooJourFerie = True : Exit Function
-
- Ascension = Paques.AddDays(38) 'Ascension
- If JJ = Microsoft.VisualBasic.Day(Ascension) And MM = Month(Ascension) Then BooJourFerie = True : Exit Function
-
- Pentecote = Ascension.AddDays(11) 'Pentecote
- If JJ = Microsoft.VisualBasic.Day(Pentecote) And MM = Month(Pentecote) Then BooJourFerie = True : Exit Function
-
- BooJourFerie = False
- End Function
Function BooJourFerie(ByVal Jour As Date) As Boolean
Dim JJ, AA, MM As Integer
Dim NbOr, Epacte As Integer
Dim PLune, Paques, Ascension, Pentecote As Date
JJ = Microsoft.VisualBasic.Day(Jour)
MM = Month(Jour)
AA = Year(Jour)
If JJ = 1 And MM = 1 Then BooJourFerie = True : Exit Function '1 Janvier
If JJ = 1 And MM = 5 Then BooJourFerie = True : Exit Function '1 Mai
If JJ = 8 And MM = 5 Then BooJourFerie = True : Exit Function '8 Mai
If JJ = 14 And MM = 7 Then BooJourFerie = True : Exit Function '14 Juillet
If JJ = 15 And MM = 8 Then BooJourFerie = True : Exit Function '15 Août
If JJ = 1 And MM = 11 Then BooJourFerie = True : Exit Function '1 Novembre
If JJ = 11 And MM = 11 Then BooJourFerie = True : Exit Function '11 Novembre
If JJ = 25 And MM = 12 Then BooJourFerie = True : Exit Function '25 Décembre
NbOr = (AA Mod 19) + 1
Epacte = CType((11 * NbOr - (3 + Int((2 + Int(AA / 100)) * 3 / 7))) Mod 30, Integer)
PLune = CDate("19/04/" & AA)
PLune = PLune.AddDays(-((Epacte + 6) Mod 30))
If Epacte = 24 Then PLune = PLune.AddDays(-1)
If Epacte = 25 And (AA >= 1900 And AA < 2000) Then PLune = PLune.AddDays(-1)
Paques = PLune.AddDays(-Weekday(PLune) + vbMonday + 7) 'Paques
If JJ = Microsoft.VisualBasic.Day(Paques) And MM = Month(Paques) Then BooJourFerie = True : Exit Function
Ascension = Paques.AddDays(38) 'Ascension
If JJ = Microsoft.VisualBasic.Day(Ascension) And MM = Month(Ascension) Then BooJourFerie = True : Exit Function
Pentecote = Ascension.AddDays(11) 'Pentecote
If JJ = Microsoft.VisualBasic.Day(Pentecote) And MM = Month(Pentecote) Then BooJourFerie = True : Exit Function
BooJourFerie = False
End Function