SPRegionalSettings.FirstWeekOfYear Property
Gets or sets the first week of the year used in calendars on the server.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
The following code example sets the first week of the year to be the first full week of the year.
using (SPSite oSiteCollection = new SPSite("http://localhost")) { using (SPWeb oWebsiteRoot = oSiteCollection.RootWeb) { SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings; oRegionalSettings.FirstWeekOfYear = 1; oWebsiteRoot.Update(); } }
Note |
|---|
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects. |
Explanation of values
0 = Starts on Jan 1
$01 = First full week$0
$02 = First 4-day week (ISO8601 standard)$0
$0$0
$0
$0Note: The ISO8601 standard definition for weeks has FirstDayOfWeek = 1 (Monday), and FirstWeekOfYear = 2 (first week with 4 days).$0
$0$0
$0
- 3/10/2011
- sly.gryphon
Note