Class DurationFormat
java.lang.Object
org.jboss.elemento.intl.DurationFormat
@JsType(isNative=true,
namespace="<global>",
name="Intl.DurationFormat")
public class DurationFormat
extends Object
Mapping for
Intl.DurationFormat.
var duration = duration()
.hours(1)
.minutes(46)
.seconds(40);
// With style set to "long" and locale "fr-FR"
durationFormat("fr-FR", durationFormatOptions().style(long_)).format(duration);
// "1 heure, 46 minutes et 40 secondes"
// With style set to "short" and locale "en"
durationFormat("en", durationFormatOptions().style(short_)).format(duration);
// "1 hr, 46 min and 40 sec"
// With style set to "narrow" and locale "pt"
durationFormat("pt", durationFormatOptions().style(narrow)).format(duration);
// "1 h 46 min 40 s"
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DurationFormatstatic DurationFormatdurationFormat(String locale) static DurationFormatdurationFormat(String[] locales) static DurationFormatdurationFormat(String[] locales, DurationFormatOptions options) static DurationFormatdurationFormat(String locale, DurationFormatOptions options) static DurationFormatdurationFormat(DurationFormatOptions options) static DurationFormatdurationFormat(Locale locale) static DurationFormatdurationFormat(Locale[] locales) static DurationFormatdurationFormat(Locale[] locales, DurationFormatOptions options) static DurationFormatdurationFormat(Locale locale, DurationFormatOptions options) elemental2.core.JsArray<jsinterop.base.JsPropertyMap<String>> formatToParts(Duration duration) jsinterop.base.JsPropertyMap<String> static 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
-
durationFormat
-
durationFormat
-
durationFormat
-
durationFormat
-
durationFormat
-
durationFormat
-
durationFormat
@JsOverlay public static DurationFormat durationFormat(String locale, DurationFormatOptions options) -
durationFormat
@JsOverlay public static DurationFormat durationFormat(Locale locale, DurationFormatOptions options) -
durationFormat
@JsOverlay public static DurationFormat durationFormat(String[] locales, DurationFormatOptions options) -
durationFormat
@JsOverlay public static DurationFormat durationFormat(Locale[] locales, DurationFormatOptions 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
-
formatToParts
-
resolvedOptions
-