core / io.islandtime.parser / DateTimeParserBuilder / localizedText

localizedText

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) abstract fun localizedText(field: DateTimeField, styles: Set<TextStyle>): Unit

Parse localized text associated with a particular DateTimeField in any of the specified styles. If successful, the field's value will be populated. If no text is known for the field or a match can't be found, the parsing operation will return an error.

The locale used when matching text is determined by the DateTimeParserSettings in use. Text is provided by the configured DateTimeTextProvider. Be mindful that this text may differ between platforms and devices. If at all possible, non-localized representations should be used instead.

Parameters

field - the field to match text for

styles - the styles of text to match

See Also

DateTimeParserSettings.locale

DateTimeTextProvider