Calendar.GetActualMaximum(CalendarField) Method

Definition

Returns the maximum value that this field could have, given the current date.

[Android.Runtime.Register("getActualMaximum", "(I)I", "GetGetActualMaximum_IHandler", ApiSince=24)]
public virtual int GetActualMaximum (Android.Icu.Util.CalendarField field);
[<Android.Runtime.Register("getActualMaximum", "(I)I", "GetGetActualMaximum_IHandler", ApiSince=24)>]
abstract member GetActualMaximum : Android.Icu.Util.CalendarField -> int
override this.GetActualMaximum : Android.Icu.Util.CalendarField -> int

Parameters

field
CalendarField

the field whose maximum is desired

Returns

the maximum of the given field for the current date of this calendar

Attributes

Remarks

Returns the maximum value that this field could have, given the current date. For example, with the Gregorian date February 3, 1997 and the #DAY_OF_MONTH DAY_OF_MONTH field, the actual maximum is 28; for February 3, 1996 it is 29.

The actual maximum computation ignores smaller fields and the current value of like-sized fields. For example, the actual maximum of the DAY_OF_YEAR or MONTH depends only on the year and supra-year fields. The actual maximum of the DAY_OF_MONTH depends, in addition, on the MONTH field and any other fields at that granularity (such as IS_LEAP_MONTH). The DAY_OF_WEEK_IN_MONTH field does not depend on the current DAY_OF_WEEK; it returns the maximum for any day of week in the current month. Likewise for the WEEK_OF_MONTH and WEEK_OF_YEAR fields.

Java documentation for android.icu.util.Calendar.getActualMaximum(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