core / io.islandtime.format / DateTimeTextProvider / textFor

textFor

(iosArm64, iosX64, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) open fun textFor(field: DateTimeField, value: Long, style: TextStyle, locale: <ERROR CLASS>): String?

Get localized text for the specified field, value, style, and locale.

Parameters

field - the field to get text for

value - the value of the field

style - the style of the text

locale - the locale

Exceptions

DateTimeException - if the value if out of range for the specified field

Return
the localized text or null if unavailable

(jvm) open fun textFor(field: DateTimeField, value: Long, style: TextStyle, locale: Locale): String?

Get localized text for the specified field, value, style, and locale.

Parameters

field - the field to get text for

value - the value of the field

style - the style of the text

locale - the locale

Exceptions

DateTimeException - if the value if out of range for the specified field

Return
the localized text or null if unavailable