# DateFormat.Field

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Fields](https://developer.android.com/reference/android/icu/text/DateFormat.Field#lfields)\|[Inherited Fields](https://developer.android.com/reference/android/icu/text/DateFormat.Field#inhfields)\|[Protected Ctors](https://developer.android.com/reference/android/icu/text/DateFormat.Field#proctors)\|[Methods](https://developer.android.com/reference/android/icu/text/DateFormat.Field#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/icu/text/DateFormat.Field#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/icu/text/DateFormat.Field#inhmethods)  

# DateFormat.Field

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/icu/text/DateFormat.Field "View this page in Kotlin")\|Java

`
public
static


class
DateFormat.Field
`  
`


``


``

extends `[Format.Field](https://developer.android.com/reference/java/text/Format.Field)`


``


`

|---|---|---|-----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) |||
|   | ↳ | [java.text.Format.Field](https://developer.android.com/reference/java/text/Format.Field) ||
|   |   | ↳ | android.icu.text.DateFormat.Field |

<br />

*** ** * ** ***

The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that DateFormat.formatToCharacterIterator() method returns.

There is no public constructor to this class, the only instances are the constants defined here.

<br />

## Summary

|                                                                                                                                                ### Fields                                                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [AM_PM](https://developer.android.com/reference/android/icu/text/DateFormat.Field#AM_PM) Constant identifying the time of day indicator(am/pm).                                     |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [AM_PM_MIDNIGHT_NOON](https://developer.android.com/reference/android/icu/text/DateFormat.Field#AM_PM_MIDNIGHT_NOON) **\[icu\]**Constant identifying the am/pm/midnight/noon field. |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [DAY_OF_MONTH](https://developer.android.com/reference/android/icu/text/DateFormat.Field#DAY_OF_MONTH) Constant identifying the day of month field.                                 |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [DAY_OF_WEEK](https://developer.android.com/reference/android/icu/text/DateFormat.Field#DAY_OF_WEEK) Constant identifying the day of week field.                                    |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [DAY_OF_WEEK_IN_MONTH](https://developer.android.com/reference/android/icu/text/DateFormat.Field#DAY_OF_WEEK_IN_MONTH) Constant identifying the day of week in month field.         |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [DAY_OF_YEAR](https://developer.android.com/reference/android/icu/text/DateFormat.Field#DAY_OF_YEAR) Constant identifying the day of year field.                                    |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [DOW_LOCAL](https://developer.android.com/reference/android/icu/text/DateFormat.Field#DOW_LOCAL) Constant identifying the local day of week field.                                  |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [ERA](https://developer.android.com/reference/android/icu/text/DateFormat.Field#ERA) Constant identifying the era field.                                                            |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [EXTENDED_YEAR](https://developer.android.com/reference/android/icu/text/DateFormat.Field#EXTENDED_YEAR) Constant identifying the extended year field.                              |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [FLEXIBLE_DAY_PERIOD](https://developer.android.com/reference/android/icu/text/DateFormat.Field#FLEXIBLE_DAY_PERIOD) **\[icu\]**Constant identifying the flexible day period field. |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [HOUR0](https://developer.android.com/reference/android/icu/text/DateFormat.Field#HOUR0) Constant identifying the hour(0-11) field.                                                 |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [HOUR1](https://developer.android.com/reference/android/icu/text/DateFormat.Field#HOUR1) Constant identifying the hour(1-12) field.                                                 |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [HOUR_OF_DAY0](https://developer.android.com/reference/android/icu/text/DateFormat.Field#HOUR_OF_DAY0) Constant identifying the hour(0-23) of day field.                            |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [HOUR_OF_DAY1](https://developer.android.com/reference/android/icu/text/DateFormat.Field#HOUR_OF_DAY1) Constant identifying the hour(1-24) of day field.                            |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [JULIAN_DAY](https://developer.android.com/reference/android/icu/text/DateFormat.Field#JULIAN_DAY) Constant identifying the Julian day field.                                       |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [MILLISECOND](https://developer.android.com/reference/android/icu/text/DateFormat.Field#MILLISECOND) Constant identifying the millisecond field.                                    |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [MILLISECONDS_IN_DAY](https://developer.android.com/reference/android/icu/text/DateFormat.Field#MILLISECONDS_IN_DAY) Constant identifying the milliseconds in day field.            |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [MINUTE](https://developer.android.com/reference/android/icu/text/DateFormat.Field#MINUTE) Constant identifying the minute field.                                                   |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [MONTH](https://developer.android.com/reference/android/icu/text/DateFormat.Field#MONTH) Constant identifying the month field.                                                      |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [QUARTER](https://developer.android.com/reference/android/icu/text/DateFormat.Field#QUARTER) Constant identifying the quarter field.                                                |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [SECOND](https://developer.android.com/reference/android/icu/text/DateFormat.Field#SECOND) Constant identifying the second field.                                                   |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [TIME_ZONE](https://developer.android.com/reference/android/icu/text/DateFormat.Field#TIME_ZONE) Constant identifying the time zone field.                                          |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [WEEK_OF_MONTH](https://developer.android.com/reference/android/icu/text/DateFormat.Field#WEEK_OF_MONTH) Constant identifying the week of month field.                              |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [WEEK_OF_YEAR](https://developer.android.com/reference/android/icu/text/DateFormat.Field#WEEK_OF_YEAR) Constant identifying the week of year field.                                 |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [YEAR](https://developer.android.com/reference/android/icu/text/DateFormat.Field#YEAR) Constant identifying the year field.                                                         |
| ` public static final `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | [YEAR_WOY](https://developer.android.com/reference/android/icu/text/DateFormat.Field#YEAR_WOY) Constant identifying the year used with week of year field.                          |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ### Inherited fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) |---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [INPUT_METHOD_SEGMENT](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#INPUT_METHOD_SEGMENT) Attribute key for input method segments. | | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [LANGUAGE](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#LANGUAGE) Attribute key for the language of some text.                     | | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [READING](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#READING) Attribute key for the reading of some text.                        | |

|                                                                                                                                                     ### Protected constructors                                                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field#Field(java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` name, int calendarField) ` Constructs a`DateFormat.Field`with the given name and the`Calendar`field which this attribute represents. |

|                                                                                                                                                           ### Public methods                                                                                                                                                           ||
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                                                  | ` `[getCalendarField](https://developer.android.com/reference/android/icu/text/DateFormat.Field#getCalendarField())`() ` Returns the`Calendar`field associated with this attribute.                                           |
| ` static `[DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | ` `[ofCalendarField](https://developer.android.com/reference/android/icu/text/DateFormat.Field#ofCalendarField(int))`(int calendarField) ` Returns the`Field`constant that corresponds to the` Calendar`field`calendarField`. |

|                                                                                                                  ### Protected methods                                                                                                                   ||
|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Object](https://developer.android.com/reference/java/lang/Object) | ` `[readResolve](https://developer.android.com/reference/android/icu/text/DateFormat.Field#readResolve())`() ` Resolves instances being deserialized to the predefined constants. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute)` ` |-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` final boolean`                                                      | ` `[equals](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Compares two objects for equality. | | ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#getName())`() ` Returns the name of the attribute.                                                                                       | | ` final int`                                                          | ` `[hashCode](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#hashCode())`() ` Returns a hash code value for the object.                                                                              | | ` `[Object](https://developer.android.com/reference/java/lang/Object) | ` `[readResolve](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#readResolve())`() ` Resolves instances being deserialized to the predefined constants.                                               | | ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#toString())`() ` Returns a string representation of the object.                                                                         | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Fields

### AM_PM

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field AM_PM
```

Constant identifying the time of day indicator(am/pm).

<br />

### AM_PM_MIDNIGHT_NOON

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field AM_PM_MIDNIGHT_NOON
```

**\[icu\]**Constant identifying the am/pm/midnight/noon field.

<br />

### DAY_OF_MONTH

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field DAY_OF_MONTH
```

Constant identifying the day of month field.

<br />

### DAY_OF_WEEK

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field DAY_OF_WEEK
```

Constant identifying the day of week field.

<br />

### DAY_OF_WEEK_IN_MONTH

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field DAY_OF_WEEK_IN_MONTH
```

Constant identifying the day of week in month field.

<br />

### DAY_OF_YEAR

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field DAY_OF_YEAR
```

Constant identifying the day of year field.

<br />

### DOW_LOCAL

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field DOW_LOCAL
```

Constant identifying the local day of week field.

<br />

### ERA

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field ERA
```

Constant identifying the era field.

<br />

### EXTENDED_YEAR

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field EXTENDED_YEAR
```

Constant identifying the extended year field.

<br />

### FLEXIBLE_DAY_PERIOD

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field FLEXIBLE_DAY_PERIOD
```

**\[icu\]**Constant identifying the flexible day period field.

<br />

### HOUR0

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field HOUR0
```

Constant identifying the hour(0-11) field.

<br />

### HOUR1

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field HOUR1
```

Constant identifying the hour(1-12) field.

<br />

### HOUR_OF_DAY0

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field HOUR_OF_DAY0
```

Constant identifying the hour(0-23) of day field.

<br />

### HOUR_OF_DAY1

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field HOUR_OF_DAY1
```

Constant identifying the hour(1-24) of day field.

<br />

### JULIAN_DAY

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field JULIAN_DAY
```

Constant identifying the Julian day field.

<br />

### MILLISECOND

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field MILLISECOND
```

Constant identifying the millisecond field.

<br />

### MILLISECONDS_IN_DAY

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field MILLISECONDS_IN_DAY
```

Constant identifying the milliseconds in day field.

<br />

### MINUTE

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field MINUTE
```

Constant identifying the minute field.

<br />

### MONTH

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field MONTH
```

Constant identifying the month field.

<br />

### QUARTER

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field QUARTER
```

Constant identifying the quarter field.

<br />

### SECOND

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field SECOND
```

Constant identifying the second field.

<br />

### TIME_ZONE

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field TIME_ZONE
```

Constant identifying the time zone field.

<br />

### WEEK_OF_MONTH

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field WEEK_OF_MONTH
```

Constant identifying the week of month field.

<br />

### WEEK_OF_YEAR

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field WEEK_OF_YEAR
```

Constant identifying the week of year field.

<br />

### YEAR

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field YEAR
```

Constant identifying the year field.

<br />

### YEAR_WOY

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final DateFormat.Field YEAR_WOY
```

Constant identifying the year used with week of year field.

<br />

## Protected constructors

### Field

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected Field (String name, 
                int calendarField)
```

Constructs a`DateFormat.Field`with the given name and the`Calendar`field which this attribute represents. Use -1 for`calendarField`if this field does not have a corresponding`Calendar`field.

<br />

|                       Parameters                        ||
|-----------------|----------------------------------------|
| `name`          | `String`: Name of the attribute <br /> |
| `calendarField` | `int`:`Calendar`field constant <br />  |

## Public methods

### getCalendarField

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getCalendarField ()
```

Returns the`Calendar`field associated with this attribute. If there is no corresponding`Calendar`available, this will return -1.

<br />

|                       Returns                        ||
|-------|-----------------------------------------------|
| `int` | `Calendar`constant for this attribute. <br /> |

### ofCalendarField

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static DateFormat.Field ofCalendarField (int calendarField)
```

Returns the`Field`constant that corresponds to the`
Calendar`field`calendarField`. If there is no corresponding`Field`is available, null is returned.

<br />

|                       Parameters                       ||
|-----------------|---------------------------------------|
| `calendarField` | `int`:`Calendar`field constant <br /> |

|                                                                                            Returns                                                                                            ||
|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| [DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) | `Field`associated with the`calendarField`, or null if no associated`Field`is available. <br /> |

|                                                                              Throws                                                                              ||
|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException) | if`calendarField`is not a valid`Calendar`field constant. |

## Protected methods

### readResolve

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected Object readResolve ()
```

Resolves instances being deserialized to the predefined constants.

<br />

|                                                 Returns                                                  ||
|--------------------------------------------------------------------|--------------------------------------|
| [Object](https://developer.android.com/reference/java/lang/Object) | the resolved`Attribute`object <br /> |

|                                                                  Throws                                                                  ||
|--------------------------------------------------------------------------------------------------|----------------------------------------|
| [InvalidObjectException](https://developer.android.com/reference/java/io/InvalidObjectException) | if the constant could not be resolved. |