Überstundenauszahlung, TimasAPI, etc.
This commit is contained in:
@@ -50,22 +50,24 @@ Public Class cFeiertage
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function GetFirstyDayInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
|
||||
Public Function GetFirstyDayYInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer, Optional irgnoreDay As Boolean = False) 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
|
||||
If Not irgnoreDay Then
|
||||
|
||||
While startDate.DayOfWeek <> day
|
||||
startDate = startDate.AddDays(1)
|
||||
End While
|
||||
End If
|
||||
|
||||
Return startDate
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetLastyDayInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer) As DateTime
|
||||
Public Function GetLastyDayYInxMonth(ByVal day As DayOfWeek, ByVal month As Integer, ByVal year As Integer, Optional irgnoreDay As Boolean = False) As DateTime
|
||||
|
||||
' Create a start date for the last weekday of the month
|
||||
Dim startDate As DateTime
|
||||
@@ -77,9 +79,14 @@ Public Class cFeiertage
|
||||
startDate = startDate.AddDays(-1)
|
||||
End If
|
||||
|
||||
While (startDate.DayOfWeek <> day)
|
||||
If irgnoreDay Then
|
||||
startDate = startDate.AddDays(-1)
|
||||
End While
|
||||
Else
|
||||
While (startDate.DayOfWeek <> day)
|
||||
startDate = startDate.AddDays(-1)
|
||||
End While
|
||||
End If
|
||||
|
||||
|
||||
Return startDate
|
||||
|
||||
@@ -268,9 +275,9 @@ Public Class cFeiertage
|
||||
|
||||
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 = GetLastyDayInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Spring Bank Holiday Letzter Montag im Mai
|
||||
If datum = GetLastyDayInxMonth(DayOfWeek.Monday, 8, _Year) Then Return True 'Summer Bank Holiday Letzter Montag im August
|
||||
If datum = GetFirstyDayYInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Early May Bank Holiday Erster Montag im Mai
|
||||
If datum = GetLastyDayYInxMonth(DayOfWeek.Monday, 5, _Year) Then Return True 'Spring Bank Holiday Letzter Montag im Mai
|
||||
If datum = GetLastyDayYInxMonth(DayOfWeek.Monday, 8, _Year) Then Return True 'Summer Bank Holiday Letzter Montag im August
|
||||
|
||||
Return False
|
||||
Case Else
|
||||
|
||||
Reference in New Issue
Block a user