How to use the intl-relativeformat.__addLocaleData 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 formatjs / react-intl / test / unit / locale-data-registry.js View on Github external
it('delegates to IntlRelativeFormat', () => {
            emptyLocaleData();
            expect(registry.hasLocaleData('en')).toBe(false);

            IntlRelativeFormat.__addLocaleData(IRF_LOCALE_DATA.en);
            expect(registry.hasLocaleData('en')).toBe(true);
        });
github formatjs / react-intl / src / locale-data-registry.js View on Github external
export function addLocaleData(data = []) {
  let locales = Array.isArray(data) ? data : [data];

  IntlRelativeFormat.__addLocaleData(...locales.filter(l => !!l.locale));
}
github ember-intl / ember-intl / addon / utils / add-locale-data.js View on Github external
export default function(data) {
  IntlMessageFormat.__addLocaleData(data);
  IntlRelativeFormat.__addLocaleData(data);
}

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