Calendar.WeekNumber Method

Definition

Overloads

WeekNumber(Int32, Int32, Int32)

Returns the week number of a day, within a period.

WeekNumber(Int32, Int32)

Returns the week number of a day, within a period.

WeekNumber(Int32, Int32, Int32)

Returns the week number of a day, within a period.

[Android.Runtime.Register("weekNumber", "(III)I", "GetWeekNumber_IIIHandler", ApiSince=24)]
protected virtual int WeekNumber (int desiredDay, int dayOfPeriod, int dayOfWeek);
[<Android.Runtime.Register("weekNumber", "(III)I", "GetWeekNumber_IIIHandler", ApiSince=24)>]
abstract member WeekNumber : int * int * int -> int
override this.WeekNumber : int * int * int -> int

Parameters

desiredDay
Int32

The #DAY_OF_YEAR DAY_OF_YEAR or #DAY_OF_MONTH DAY_OF_MONTH whose week number is desired. Should be 1 for the first day of the period.

dayOfPeriod
Int32

The #DAY_OF_YEAR DAY_OF_YEAR or #DAY_OF_MONTH DAY_OF_MONTH for a day in the period whose #DAY_OF_WEEK DAY_OF_WEEK is specified by the dayOfWeek parameter. Should be 1 for first day of period.

dayOfWeek
Int32

The #DAY_OF_WEEK DAY_OF_WEEK for the day corresponding to the dayOfPeriod parameter. 1-based with 1=Sunday.

Returns

The week number (one-based), or zero if the day falls before the first week because #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek is more than one.

Attributes

Remarks

Returns the week number of a day, within a period. This may be the week number in a year or the week number in a month. Usually this will be a value &gt;= 1, but if some initial days of the period are excluded from week 1, because #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek is &gt; 1, then the week number will be zero for those initial days. This method requires the day number and day of week for some known date in the period in order to determine the day of week on the desired day.

<b>Subclassing:</b> <br> This method is intended for use by subclasses in implementing their #computeTime computeTime and/or #computeFields computeFields methods. It is often useful in #getActualMinimum getActualMinimum and #getActualMaximum getActualMaximum as well.

This variant is handy for computing the week number of some other day of a period (often the first or last day of the period) when its day of the week is not known but the day number and day of week for some other day in the period (e.g. the current date) <em>is</em> known.

Java documentation for android.icu.util.Calendar.weekNumber(int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

WeekNumber(Int32, Int32)

Returns the week number of a day, within a period.

[Android.Runtime.Register("weekNumber", "(II)I", "", ApiSince=24)]
protected int WeekNumber (int dayOfPeriod, int dayOfWeek);
[<Android.Runtime.Register("weekNumber", "(II)I", "", ApiSince=24)>]
member this.WeekNumber : int * int -> int

Parameters

dayOfPeriod
Int32

The #DAY_OF_YEAR DAY_OF_YEAR or #DAY_OF_MONTH DAY_OF_MONTH whose week number is desired. Should be 1 for the first day of the period.

dayOfWeek
Int32

The #DAY_OF_WEEK DAY_OF_WEEK for the day corresponding to the dayOfPeriod parameter. 1-based with 1=Sunday.

Returns

The week number (one-based), or zero if the day falls before the first week because #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek is more than one.

Attributes

Remarks

Returns the week number of a day, within a period. This may be the week number in a year, or the week number in a month. Usually this will be a value &gt;= 1, but if some initial days of the period are excluded from week 1, because #getMinimalDaysInFirstWeek getMinimalDaysInFirstWeek is &gt; 1, then the week number will be zero for those initial days. This method requires the day of week for the given date in order to determine the result.

<b>Subclassing:</b> <br> This method is intended for use by subclasses in implementing their #computeTime computeTime and/or #computeFields computeFields methods. It is often useful in #getActualMinimum getActualMinimum and #getActualMaximum getActualMaximum as well.

Java documentation for android.icu.util.Calendar.weekNumber(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to