Compartir a través de


Calendar.GetDisplayName(Int32, Int32, Locale) Method

Definition

Returns the string representation of the calendar field value in the given style and locale.

[Android.Runtime.Register("getDisplayName", "(IILjava/util/Locale;)Ljava/lang/String;", "GetGetDisplayName_IILjava_util_Locale_Handler")]
public virtual string? GetDisplayName (int field, int style, Java.Util.Locale locale);
[<Android.Runtime.Register("getDisplayName", "(IILjava/util/Locale;)Ljava/lang/String;", "GetGetDisplayName_IILjava_util_Locale_Handler")>]
abstract member GetDisplayName : int * int * Java.Util.Locale -> string
override this.GetDisplayName : int * int * Java.Util.Locale -> string

Parameters

field
Int32

the calendar field for which the string representation is returned

style
Int32

the style applied to the string representation; one of #SHORT_FORMAT (#SHORT), #SHORT_STANDALONE, #LONG_FORMAT (#LONG), #LONG_STANDALONE, #NARROW_FORMAT, or #NARROW_STANDALONE.

locale
Locale

the locale for the string representation (any calendar types specified by locale are ignored)

Returns

the string representation of the given field in the given style, or null if no string representation is applicable.

Attributes

Exceptions

if locale == null

if field or style is invalid

Remarks

Java documentation for java.util.Calendar.getDisplayName(int, int, java.util.Locale).

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