'Imports System.Globalization
Private Function GetMondayDateOfWeek(week As Integer, year As Integer) As DateTime
Dim i As Integer = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(New DateTime(year, 1, 1), CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
If i = 1 Then
Return CultureInfo.CurrentCulture.Calendar.AddDays(New DateTime(year, 1, 1), ((week - 1) * 7 - GetDayCountFromMonday(CultureInfo.CurrentCulture.Calendar.GetDayOfWeek(New DateTime(year, 1, 1))) + 1))
Else
Dim x As Integer = Convert.ToInt32(CultureInfo.CurrentCulture.Calendar.GetDayOfWeek(New DateTime(year, 1, 1)))
Return CultureInfo.CurrentCulture.Calendar.AddDays(New DateTime(year, 1, 1), ((week - 1) * 7 + (7 - GetDayCountFromMonday(CultureInfo.CurrentCulture.Calendar.GetDayOfWeek(New DateTime(year, 1, 1)))) + 1))
End If
End Function
'Gibt den Wochentag als Zahl zurück, Montag entspricht 1
Private Function GetDayCountFromMonday(dow As DayOfWeek) As Integer
Select Case dow
Case DayOfWeek.Monday
Return 1
Case DayOfWeek.Tuesday
Return 2
Case DayOfWeek.Wednesday
Return 3
Case DayOfWeek.Thursday
Return 4
Case DayOfWeek.Friday
Return 5
Case DayOfWeek.Saturday
Return 6
Case Else
'Sunday
Return 7
End Select
End Function