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:
-
Method Summary
Modifier and TypeMethodDescriptionfinal Stringstatic RelativeTimeFormatstatic RelativeTimeFormatrelativeTimeFormat(String locale) static RelativeTimeFormatrelativeTimeFormat(String[] locales) static RelativeTimeFormatrelativeTimeFormat(String[] locales, RelativeTimeFormatOptions options) static RelativeTimeFormatrelativeTimeFormat(String locale, RelativeTimeFormatOptions options) static RelativeTimeFormatrelativeTimeFormat(Locale locale) static RelativeTimeFormatrelativeTimeFormat(Locale[] locales) static RelativeTimeFormatrelativeTimeFormat(Locale[] locales, RelativeTimeFormatOptions options) static RelativeTimeFormatrelativeTimeFormat(Locale locale, RelativeTimeFormatOptions options) static RelativeTimeFormatstatic elemental2.core.JsArray<String> supportedLocalesOf(String locale) static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales) static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options)
-
Method Details
-
relativeTimeFormat
-
relativeTimeFormat
-
relativeTimeFormat
-
relativeTimeFormat
-
relativeTimeFormat
-
relativeTimeFormat
-
relativeTimeFormat
@JsOverlay public static RelativeTimeFormat relativeTimeFormat(String locale, RelativeTimeFormatOptions options) -
relativeTimeFormat
@JsOverlay public static RelativeTimeFormat relativeTimeFormat(Locale locale, RelativeTimeFormatOptions options) -
relativeTimeFormat
@JsOverlay public static RelativeTimeFormat relativeTimeFormat(String[] locales, RelativeTimeFormatOptions options) -
relativeTimeFormat
@JsOverlay public static RelativeTimeFormat relativeTimeFormat(Locale[] locales, RelativeTimeFormatOptions options) -
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(String locale, SupportOptions options) -
supportedLocalesOf
-
supportedLocalesOf
public static elemental2.core.JsArray<String> supportedLocalesOf(jsinterop.base.JsArrayLike<String> locales, SupportOptions options) -
format
-
format
-