This is the latest docs version
Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
Core Module
Overview
Core
submodules
  • Array
  • ArrayBuffer
  • AsyncIterator
  • BigInt
  • BigInt64Array
    • Constants
    BigUint64Array
    • Constants
  • Console
  • DataView
  • Date
    • UTC
  • Dict
  • Error
    • URIError
    • TypeError
    • SyntaxError
    • ReferenceError
    • RangeError
    • EvalError
  • Exn
  • Float
    • Constants
    Float32Array
    • Constants
    Float64Array
    • Constants
    Int
    • Constants
    Int16Array
    • Constants
    Int32Array
    • Constants
    Int8Array
    • Constants
  • Internal
  • Intl
    • Segments
    • Segmenter
    • RelativeTimeFormat
      • t
        t
      • t
        numeric
      • t
        style
      • t
        timeUnit
      • t
        options
      • t
        supportedLocalesOptions
      • t
        resolvedOptions
      • t
        relativeTimePartComponent
      • t
        relativeTimePart
      • v
        make
      • v
        supportedLocalesOf
      • v
        resolvedOptions
      • v
        format
      • v
        formatToParts
    • PluralRules
    • NumberFormat
      • Grouping
    • Locale
    • ListFormat
    • DateTimeFormat
    • Collator
    • Common
  • Iterator
  • JSON
    • Decode
    • Encode
    • Classify
  • List
  • Map
  • MapperRt
  • Math
    • Int
    • Constants
  • Null
  • Nullable
  • Object
  • Option
  • Ordering
  • Promise
  • Re
    • Result
    RegExp
    • Result
  • Result
  • Set
  • String
  • Symbol
  • Type
    • Classify
  • TypedArray
  • Uint16Array
    • Constants
    Uint32Array
    • Constants
    Uint8Array
    • Constants
    Uint8ClampedArray
    • Constants
  • WeakMap
  • WeakSet
  • 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>
    Types and values
    • t
      t
    • t
      numeric
    • t
      style
    • t
      timeUnit
    • t
      options
    • t
      supportedLocalesOptions
    • t
      resolvedOptions
    • t
      relativeTimePartComponent
    • t
      relativeTimePart
    • v
      make
    • v
      supportedLocalesOf
    • v
      resolvedOptions
    • v
      format
    • v
      formatToParts

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on