@formatjs/intl-relativetimeformat

  • Version 13.0.5
  • Published
  • 5.97 MB
  • 1 dependency
  • MIT license

Install

npm i @formatjs/intl-relativetimeformat
yarn add @formatjs/intl-relativetimeformat
pnpm add @formatjs/intl-relativetimeformat

Overview

Formats JavaScript dates to relative time strings.

Index

Variables

variable nullClassBase

const nullClassBase: abstract new () => object;

    Classes

    class RelativeTimeFormat

    class RelativeTimeFormat extends nullClassBase {}

      constructor

      constructor(
      locales?: string | string[],
      options?: Intl.RelativeTimeFormatOptions
      );

        property localeData

        static localeData: Record<string, LocaleFieldsData>;

          property polyfilled

          static polyfilled: boolean;

            method format

            format: (value: number, unit: Intl.RelativeTimeFormatUnit) => string;

              method formatToParts

              formatToParts: (
              value: number,
              unit: Intl.RelativeTimeFormatUnit
              ) => Intl.RelativeTimeFormatPart[];

                method resolvedOptions

                resolvedOptions: () => Intl.ResolvedRelativeTimeFormatOptions;

                  method supportedLocalesOf

                  static supportedLocalesOf: (
                  locales: string | string[],
                  options?: Pick<Intl.RelativeTimeFormatOptions, 'localeMatcher'>
                  ) => string[];

                    Package Files (1)

                    Dependencies (1)

                    Dev Dependencies (0)

                    No dev dependencies.

                    Peer Dependencies (0)

                    No peer dependencies.

                    Badge

                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@formatjs/intl-relativetimeformat.

                    • Markdown
                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@formatjs/intl-relativetimeformat)
                    • HTML
                      <a href="https://www.jsdocs.io/package/@formatjs/intl-relativetimeformat"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>