Skip to content

Instantly share code, notes, and snippets.

@JamesIgoe
Created October 5, 2018 15:22
Show Gist options
  • Save JamesIgoe/5c5b867bf2b3bb9d4a663c88f11ed0eb to your computer and use it in GitHub Desktop.
Save JamesIgoe/5c5b867bf2b3bb9d4a663c88f11ed0eb to your computer and use it in GitHub Desktop.
Public Class DateHelpers
Public Shared Function GetNextWeekday(ByVal start As DateTime, ByVal day As DayOfWeek) As Integer
Return (CInt(day) - CInt(start.DayOfWeek) + 7) Mod 7
End Function
Public Shared Function DateWeek(item As Date) As Integer
Dim temp = DatePart(DateInterval.WeekOfYear, item, FirstDayOfWeek.Sunday, FirstWeekOfYear.FirstFourDays)
Return temp
End Function
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment