API / Core / Intl / Relativetimeformat

RelativeTimeFormat

t

RESCRIPT
type t

numeric

RESCRIPT
type numeric = [#always | #auto]

style

RESCRIPT
type style = [#long | #narrow | #short]

timeUnit

RESCRIPT
type timeUnit = [ | #day | #hour | #minute | #month | #quarter | #second | #week | #year ]

options

RESCRIPT
type options = { localeMatcher?: Core__Intl__Common.localeMatcher, numeric?: numeric, style?: style, }

supportedLocalesOptions

RESCRIPT
type supportedLocalesOptions = { localeMatcher: Core__Intl__Common.localeMatcher, }

resolvedOptions

RESCRIPT
type resolvedOptions = { locale: string, numeric: numeric, style: style, numberingSystem: string, }

relativeTimePartComponent

RESCRIPT
type relativeTimePartComponent = [#integer | #literal]

relativeTimePart

RESCRIPT
type relativeTimePart = { \"type": relativeTimePartComponent, value: string, unit?: timeUnit, }

make

RESCRIPT
let make: (~locales: array<string>=?, ~options: options=?) => t

supportedLocalesOf

RESCRIPT
let supportedLocalesOf: (array<string>, ~options: supportedLocalesOptions=?) => t

resolvedOptions

RESCRIPT
let resolvedOptions: t => resolvedOptions

format

RESCRIPT
let format: (t, int, timeUnit) => string

formatToParts

RESCRIPT
let formatToParts: (t, int, timeUnit) => array<relativeTimePart>