DateOptions Constructor (String, SPCalendarType, String, String, String, String, String, Boolean, String)
Initializes a new instance of the DateOptions class, based upon the locale identifier, calendar type, work days in a week, first day of the week displayed in the calendar, adjustment for Ramadan and regional differences, the time zone offset from UTC, the last year of a 100-year range, whether the ISO8601 date format will be used, and the currently selected calendar date.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Sub New ( _
localeId As String, _
calendar As SPCalendarType, _
workWeek As String, _
firstDayOfWeek As String, _
hijriAdjustment As String, _
timeZoneSpan As String, _
twoDigitYearMax As String, _
isoDate As Boolean, _
selectedDate As String _
)
'Usage
Dim localeId As String
Dim calendar As SPCalendarType
Dim workWeek As String
Dim firstDayOfWeek As String
Dim hijriAdjustment As String
Dim timeZoneSpan As String
Dim twoDigitYearMax As String
Dim isoDate As Boolean
Dim selectedDate As String
Dim instance As New DateOptions(localeId, _
calendar, workWeek, firstDayOfWeek, _
hijriAdjustment, timeZoneSpan, twoDigitYearMax, _
isoDate, selectedDate)
public DateOptions(
string localeId,
SPCalendarType calendar,
string workWeek,
string firstDayOfWeek,
string hijriAdjustment,
string timeZoneSpan,
string twoDigitYearMax,
bool isoDate,
string selectedDate
)
Parameters
localeId
Type: System.StringA string that contains the locale identifier, for example “1033”.
calendar
Type: Microsoft.SharePoint.SPCalendarTypeAn SPCalendarType object that represents the calendar type.
workWeek
Type: System.StringA string that contains the seven-character string that indicates the work days in a week, where 1 is a work day and 0 is not a work day; for example "0111110" represents a Monday–Friday work week for a week whose first day is Sunday.
firstDayOfWeek
Type: System.StringA string that contains a numeric value that represents the first day of the week displayed in the calendar. The valid value range is 0 through 6; 0 indicates Sunday, 1 indicates Monday, and so on.
hijriAdjustment
Type: System.StringA string that contains a numeric value that represents the number of days to add to or subtract from the calendar to accommodate the variances in the start and the end of Ramadan, and to accommodate the date difference between countries or regions. The valid values are -2, -1, 0, 1, and 2.
timeZoneSpan
Type: System.StringA string that describes a TimeSpan, which is used as the zone offset from UTC.
twoDigitYearMax
Type: System.StringA string that contains a numeric value that represents the last year of a 100-year range that can be represented by a 2-digit year.
For example, "2029" specifies that two-digit years be interpreted as falling between 1930 and 2029. Values between "30" and "99" are interpreted as being in the range of years 1930-1990, while values between "0" and "29" are interpreted as being in range of years 2000-2029. See also TwoDigitYearMax.
isoDate
Type: System.Booleantrue to parse the selectedDate parameter using the ISO8601 date format, for example, “yyyy-mm-dd”; otherwise, false.
selectedDate
Type: System.StringA string that contains the currently selected calendar date.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The firstDayOfWeek parameter value is out of range. The hijriAdjustment parameter value is out of range. The timeZoneSpan parameter cannot be parsed as a TimeSpan. |