Share via


Calendar.PinField(CalendarField) Method

Definition

Adjust the specified field so that it is within the allowable range for the date to which this calendar is set.

[Android.Runtime.Register("pinField", "(I)V", "GetPinField_IHandler", ApiSince=24)]
protected virtual void PinField (Android.Icu.Util.CalendarField field);
[<Android.Runtime.Register("pinField", "(I)V", "GetPinField_IHandler", ApiSince=24)>]
abstract member PinField : Android.Icu.Util.CalendarField -> unit
override this.PinField : Android.Icu.Util.CalendarField -> unit

Parameters

field
CalendarField

The calendar field whose value should be pinned.

Attributes

Remarks

Adjust the specified field so that it is within the allowable range for the date to which this calendar is set. For example, in a Gregorian calendar pinning the #DAY_OF_MONTH DAY_OF_MONTH field for a calendar set to April 31 would cause it to be set to April 30.

<b>Subclassing:</b> <br> This utility method is intended for use by subclasses that need to implement their own overrides of #roll roll and #add add.

<b>Note:</b> pinField is implemented in terms of #getActualMinimum getActualMinimum and #getActualMaximum getActualMaximum. If either of those methods uses a slow, iterative algorithm for a particular field, it would be unwise to attempt to call pinField for that field. If you really do need to do so, you should override this method to do something more efficient for that field.

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