Question Function to calculate the Enddate of weekly appointments

Horst Klein

New member
Joined
Aug 17, 2009
Messages
1
Programming Experience
10+
Is there in the deep of the Framework 3.0 Namespaces a function to get the EndDate for weekly Appointments?

Best regards
Horst
 
EndDate of weekly appointments

If what you require is the date of the last day of the week you can get it like this:
VB.NET:
	Private Sub EndOfWeekTestForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Dim today As DateTime = DateTime.Now
		Me.txtToday.Text = today.ToShortDateString()

		Dim eow As DateTime = today.AddDays(CType(DayOfWeek.Saturday, Integer) - CType(today.DayOfWeek, Integer))
		Me.txtEndOfWeek.Text = eow.ToShortDateString()
	End Sub

This is the Load event handler for a simple Form with two TextBoxes.

The DayOfWeek property treats Sunday as day 0 (zero) and Saturday as day 6.

If I have misunderstood your question, please ignore this post. :)
 
Back
Top