@formatjs/intl-relativetimeformat
- Version 12.3.15
- Published
- 12.4 MB
- 1 dependency
- MIT license
Install
npm i @formatjs/intl-relativetimeformatyarn add @formatjs/intl-relativetimeformatpnpm add @formatjs/intl-relativetimeformatOverview
Formats JavaScript dates to relative time strings.
Index
Classes
class RelativeTimeFormat
class RelativeTimeFormat {}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[];Interfaces
interface FieldData
interface FieldData {}interface LocaleData
interface LocaleData<T> {}Type Aliases
type LDMLPluralRule
type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';type Locale
type Locale = string;type LocaleFieldsData
type LocaleFieldsData = { [f in RelativeTimeField]?: FieldData } & { nu?: Array<string | null>;};type RelativeTimeData
type RelativeTimeData = { [u in LDMLPluralRule]?: string };type RelativeTimeField
type RelativeTimeField = | 'second' | 'second-short' | 'second-narrow' | 'minute' | 'minute-short' | 'minute-narrow' | 'hour' | 'hour-short' | 'hour-narrow' | 'day' | 'day-short' | 'day-narrow' | 'week' | 'week-short' | 'week-narrow' | 'month' | 'month-short' | 'month-narrow' | 'quarter' | 'quarter-short' | 'quarter-narrow' | 'year' | 'year-short' | 'year-narrow';type RelativeTimeLocaleData
type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto 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[](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>
- Updated .
Package analyzed in 3765 ms. - Missing or incorrect documentation? Open an issue for this package.
