Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

RelativeDateTimeFormatter.RelativeDateTimeUnit

public static final enum RelativeDateTimeFormatter.RelativeDateTimeUnit
extends Enum<RelativeDateTimeFormatter.RelativeDateTimeUnit>

java.lang.Object
   ↳ java.lang.Enum<android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit>
     ↳ android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit


Represents the unit for formatting a relative date. e.g "in 5 days" or "next year"

Summary

Enum values

RelativeDateTimeFormatter.RelativeDateTimeUnit  DAY

Specifies that relative unit is day, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  FRIDAY

Specifies that relative unit is Friday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  HOUR

Specifies that relative unit is hour, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  MINUTE

Specifies that relative unit is minute, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  MONDAY

Specifies that relative unit is Monday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  MONTH

Specifies that relative unit is month, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  QUARTER

Specifies that relative unit is quarter, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  SATURDAY

Specifies that relative unit is Saturday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  SECOND

Specifies that relative unit is second, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  SUNDAY

Specifies that relative unit is Sunday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  THURSDAY

Specifies that relative unit is Thursday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  TUESDAY

Specifies that relative unit is Tuesday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  WEDNESDAY

Specifies that relative unit is Wednesday, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  WEEK

Specifies that relative unit is week, e.g. 

RelativeDateTimeFormatter.RelativeDateTimeUnit  YEAR

Specifies that relative unit is year, e.g. 

Public methods

static RelativeDateTimeFormatter.RelativeDateTimeUnit valueOf(String name)
static final RelativeDateTimeUnit[] values()

Inherited methods

Enum values

DAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit DAY

Specifies that relative unit is day, e.g. "yesterday", "in 5 days".

FRIDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit FRIDAY

Specifies that relative unit is Friday, e.g. "last Friday", "this Friday", "next Friday", "in 5 Fridays".

HOUR

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit HOUR

Specifies that relative unit is hour, e.g. "1 hour ago", "in 5 hours".

MINUTE

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit MINUTE

Specifies that relative unit is minute, e.g. "1 minute ago", "in 5 minutes".

MONDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit MONDAY

Specifies that relative unit is Monday, e.g. "last Monday", "this Monday", "next Monday", "in 5 Mondays".

MONTH

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit MONTH

Specifies that relative unit is month, e.g. "last month", "in 5 months".

QUARTER

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit QUARTER

Specifies that relative unit is quarter, e.g. "last quarter", "in 5 quarters".

SATURDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit SATURDAY

Specifies that relative unit is Saturday, e.g. "last Saturday", "this Saturday", "next Saturday", "in 5 Saturdays".

SECOND

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit SECOND

Specifies that relative unit is second, e.g. "1 second ago", "in 5 seconds".

SUNDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit SUNDAY

Specifies that relative unit is Sunday, e.g. "last Sunday", "this Sunday", "next Sunday", "in 5 Sundays".

THURSDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit THURSDAY

Specifies that relative unit is Thursday, e.g. "last Thursday", "this Thursday", "next Thursday", "in 5 Thursdays".

TUESDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit TUESDAY

Specifies that relative unit is Tuesday, e.g. "last Tuesday", "this Tuesday", "next Tuesday", "in 5 Tuesdays".

WEDNESDAY

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit WEDNESDAY

Specifies that relative unit is Wednesday, e.g. "last Wednesday", "this Wednesday", "next Wednesday", "in 5 Wednesdays".

WEEK

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit WEEK

Specifies that relative unit is week, e.g. "last week", "in 5 weeks".

YEAR

added in API level 28
public static final RelativeDateTimeFormatter.RelativeDateTimeUnit YEAR

Specifies that relative unit is year, e.g. "last year", "in 5 years".

Public methods

valueOf

added in API level 28
public static RelativeDateTimeFormatter.RelativeDateTimeUnit valueOf (String name)

Parameters
name String

Returns
RelativeDateTimeFormatter.RelativeDateTimeUnit

values

added in API level 28
public static final RelativeDateTimeUnit[] values ()

Returns
RelativeDateTimeUnit[]