Added in API level 28

RelativeDateTimeUnit


class RelativeDateTimeUnit
kotlin.Any
   ↳ kotlin.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

Specifies that relative unit is day, e.

Specifies that relative unit is Friday, e.

Specifies that relative unit is hour, e.

Specifies that relative unit is minute, e.

Specifies that relative unit is Monday, e.

Specifies that relative unit is month, e.

Specifies that relative unit is quarter, e.

Specifies that relative unit is Saturday, e.

Specifies that relative unit is second, e.

Specifies that relative unit is Sunday, e.

Specifies that relative unit is Thursday, e.

Specifies that relative unit is Tuesday, e.

Specifies that relative unit is Wednesday, e.

Specifies that relative unit is week, e.

Specifies that relative unit is year, e.

Enum values

DAY

Added in API level 28
enum val DAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

FRIDAY

Added in API level 28
enum val FRIDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

HOUR

Added in API level 28
enum val HOUR : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

MINUTE

Added in API level 28
enum val MINUTE : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

MONDAY

Added in API level 28
enum val MONDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

MONTH

Added in API level 28
enum val MONTH : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

QUARTER

Added in API level 28
enum val QUARTER : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

SATURDAY

Added in API level 28
enum val SATURDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

SECOND

Added in API level 28
enum val SECOND : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

SUNDAY

Added in API level 28
enum val SUNDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

THURSDAY

Added in API level 28
enum val THURSDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

TUESDAY

Added in API level 28
enum val TUESDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

WEDNESDAY

Added in API level 28
enum val WEDNESDAY : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

WEEK

Added in API level 28
enum val WEEK : RelativeDateTimeFormatter.RelativeDateTimeUnit

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

YEAR

Added in API level 28
enum val YEAR : RelativeDateTimeFormatter.RelativeDateTimeUnit

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