Share via


DateOptions constructor (String, SPCalendarType, String, String, String, String, String, 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, and the currently selected calendar date.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

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, _
    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 selectedDate As String

Dim instance As New DateOptions(localeId, _
    calendar, workWeek, firstDayOfWeek, _
    hijriAdjustment, timeZoneSpan, twoDigitYearMax, _
    selectedDate)
public DateOptions(
    string localeId,
    SPCalendarType calendar,
    string workWeek,
    string firstDayOfWeek,
    string hijriAdjustment,
    string timeZoneSpan,
    string twoDigitYearMax,
    string selectedDate
)

Parameters

  • localeId
    Type: System.String

    A string that contains the locale identifier, for example “1033”.

  • workWeek
    Type: System.String

    A 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.String

    A 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.String

    A 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.String

    A string that describes a TimeSpan, which is used as the zone offset from UTC.

  • twoDigitYearMax
    Type: System.String

    A 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.

  • selectedDate
    Type: System.String

    A 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.

See also

Reference

DateOptions class

DateOptions members

DateOptions overload

Microsoft.SharePoint.Utilities namespace