A spec-compliant polyfill for Intl.RelativeTimeFormat fully tested by the official ECMAScript Conformance test suite
This package requires the following capabilities:
If you're supporting IE11-, this requires
If you need
formatToPartsand have to support IE11- or Node 10-, you'd need to polyfill using
To use the polyfill, just import it to make sure that a fully functional Intl.RelativeTimeFormat is available in your environment:
If you want to polyfill all locales (e.g for Node):
This library is fully test262-compliant.