How to use the intl-relativeformat.defaultLocale function in intl-relativeformat

To help you get started, we’ve selected a few intl-relativeformat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / packages / kbn-i18n / src / core / i18n.ts View on Github external
export function setDefaultLocale(locale: string) {
  if (!locale || !isString(locale)) {
    throw new Error('[I18n] A `locale` must be a non-empty string.');
  }

  defaultLocale = normalizeLocale(locale);
  IntlMessageFormat.defaultLocale = defaultLocale;
  IntlRelativeFormat.defaultLocale = defaultLocale;
}

intl-relativeformat

Formats JavaScript dates to relative time strings.

BSD-3-Clause
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis