Skip to content

//core/io.islandtime.parser/DateTimeParserBuilder/localizedText

localizedText

common

abstract fun localizedText(field: DateTimeField, styles: Set<TextStyle>)

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

common

field the field to match text for
styles the styles of text to match

See also

DateTimeParserSettings.locale
DateTimeTextProvider