Hex Core JS
    Preparing search index...

    Function formatRelativeTime

    • Formats a relative time using the given locale and options. Wraps Intl.RelativeTimeFormat but selects the locale automatically based on the user's locale.

      Parameters

      • value: number

        The value to format.

      • unit: RelativeTimeFormatUnit

        The unit of the value.

      • options: RelativeTimeLocaleOptions = {}

        The options to pass to Intl.RelativeTimeFormat.

      Returns string