Feiertage
This commit is contained in:
@@ -48,6 +48,35 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function GetFirstyDayInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
|
||||
|
||||
' Create a start date for the 1st day of the month
|
||||
Dim startDate As DateTime = New DateTime(year, month, 1)
|
||||
|
||||
While startDate.DayOfWeek <> day
|
||||
startDate = startDate.AddDays(1)
|
||||
End While
|
||||
|
||||
|
||||
Return startDate
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetLastyDayInyMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
|
||||
|
||||
' Create a start date for the 1st day of the month
|
||||
Dim startDate As DateTime = New DateTime(year, month, 1)
|
||||
|
||||
While startDate.DayOfWeek <> day
|
||||
startDate = startDate.AddDays(1)
|
||||
End While
|
||||
|
||||
Return startDate
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function Ostersonntag() As Date
|
||||
Dim _month As Integer
|
||||
Dim _day As Integer
|
||||
@@ -185,39 +214,61 @@
|
||||
End Select
|
||||
End Function
|
||||
Public Function isFeiertag(datum As Date, land As String) As Boolean
|
||||
|
||||
If datum = CDate("01.01." & _Year) Then Return True
|
||||
If datum = CDate("06.01." & _Year) Then Return True
|
||||
If datum = CDate("15.08." & _Year) Then Return True
|
||||
If datum = CDate("01.11." & _Year) Then Return True
|
||||
If datum = CDate("25.12." & _Year) Then Return True
|
||||
If datum = CDate("26.12." & _Year) Then Return True
|
||||
|
||||
|
||||
If datum = Ostermontag Then Return True
|
||||
If datum = Ostersonntag() Then Return True
|
||||
If datum = Himmelfahrt Then Return True
|
||||
If datum = Pfingstmontag Then Return True
|
||||
If datum = Pfingstsonntag Then Return True
|
||||
If datum = Fronleichnam Then Return True
|
||||
|
||||
|
||||
|
||||
Select Case land
|
||||
Case "AT"
|
||||
If datum = CDate("26.10." & _Year) Then Return True
|
||||
If datum = CDate("08.12." & _Year) Then Return True
|
||||
If datum = CDate("01.05." & _Year) Then Return True 'Staatsfeiertag
|
||||
|
||||
|
||||
If datum = CDate("06.01." & _Year) Then Return True
|
||||
If datum = CDate("15.08." & _Year) Then Return True
|
||||
If datum = CDate("01.11." & _Year) Then Return True
|
||||
If datum = Ostersonntag() Then Return True
|
||||
If datum = Himmelfahrt Then Return True
|
||||
If datum = Pfingstmontag Then Return True
|
||||
If datum = Pfingstsonntag Then Return True
|
||||
If datum = Fronleichnam Then Return True
|
||||
|
||||
Case "DE" 'BAYERN
|
||||
If datum = CDate("03.10." & _Year) Then Return True ' Tag der Deutschen Einheit
|
||||
' If datum = BussUndBettag Then Return True ' Buß- und Bettag '!!!!ABEWEICHEND --> kein Feiertag in BAYERN
|
||||
' If datum = CDate("08.08." & _Year) Then Return True ' Augsburger Friedensfest
|
||||
If datum = CDate("01.05." & _Year) Then Return True ' Maifeiertag
|
||||
If datum = Karfreitag Then Return True
|
||||
Case "GB" 'BAYERN
|
||||
|
||||
|
||||
If datum = CDate("06.01." & _Year) Then Return True
|
||||
If datum = CDate("15.08." & _Year) Then Return True
|
||||
If datum = CDate("01.11." & _Year) Then Return True
|
||||
If datum = Ostersonntag() Then Return True
|
||||
If datum = Himmelfahrt Then Return True
|
||||
If datum = Pfingstmontag Then Return True
|
||||
If datum = Pfingstsonntag Then Return True
|
||||
If datum = Fronleichnam Then Return True
|
||||
|
||||
Case "GB"
|
||||
If datum = Karfreitag Then Return True
|
||||
If datum = GetFirstyDayInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Early May Bank Holiday Erster Montag im Mai
|
||||
If datum = GetLastyDayInyMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Spring Bank Holiday Letzter Montag im Mai
|
||||
If datum = GetLastyDayInyMonth(DayOfWeek.Monday, 8, _Year) Then Return True 'Summer Bank Holiday Letzter Montag im August
|
||||
|
||||
Return False
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
|
||||
'Public Function isFeiertag(datum As Date, land As String) As Boolean
|
||||
' If datum = CDate("01.01." & _Year) Then Return True
|
||||
' If datum = CDate("06.01." & _Year) Then Return True
|
||||
|
||||
Reference in New Issue
Block a user