Class RelativeTimeFormat

java.lang.Object
org.jboss.elemento.intl.RelativeTimeFormat

@JsType(isNative=true, namespace="<global>", name="Intl.RelativeTimeFormat") public class RelativeTimeFormat extends Object
Mapping for Intl.RelativeTimeFormat.

var rtf1 = relativeTimeFormat("en", relativeTimeFormatOptions()
        .style(short_));

console.log(rtf1.format(3, quarter));
// Expected output: "in 3 qtrs."

console.log(rtf1.format(-1, day));
// Expected output: "1 day ago"

var rtf2 = relativeTimeFormat("es", relativeTimeFormatOptions()
        .numeric(auto));

console.log(rtf2.format(2, day));
// Expected output: "pasado maƱana"
See Also: