Version

GetFirstWeekOfYearDate Method

Returns the System.DateTime for the first day of the year in the first week of the year.
Syntax
'Declaration
 
Public Function GetFirstWeekOfYearDate( _
   ByVal year As Integer _
) As Date
public DateTime GetFirstWeekOfYearDate( 
   int year
)

Parameters

year
Year number

Return Value

DateTime for the first day of the year in the first week number of the year.
Remarks

Returns the System.DateTime for the day that starts the first week of the year based on the WeekRule and FirstDayOfWeekResolved.

Example
This example uses the GetFirstWeekOfYearDate method to obtain the date of the first day of the first week in the current year.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.IO
Imports System.Globalization

    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click

        '	Get the date of the first day of the first week in the current year
        Dim first As DateTime
        first = Me.ultraCalendarInfo1.GetFirstWeekOfYearDate(DateTime.Today.Year)

        MessageBox.Show("The date of the first day of the first week of the current year is " + first.ToLongDateString(), "GetFirstWeekOfYearDate", MessageBoxButtons.OK)

    End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.IO;
using System.Globalization;

		private void button1_Click(object sender, System.EventArgs e)
		{

			//	Get the date of the first day of the first week in the current year
			DateTime first;
			first = this.ultraCalendarInfo1.GetFirstWeekOfYearDate( DateTime.Today.Year );

			MessageBox.Show( "The date of the first day of the first week of the current year is " + first.ToLongDateString(), "GetFirstWeekOfYearDate", MessageBoxButtons.OK );

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also