Skip to content

//core/io.islandtime.format/DateTimeTextProvider/parsableTextFor

parsableTextFor

common

open fun parsableTextFor(field: DateTimeField, style: TextStyle, locale: Locale): ParsableTextList

Get a list of all localized text in a particular style along with the values associated that text. The list will be sorted in descending order by the length of text, making it suitable for parsing.

Any text with conflicting values will be excluded. For example, the English narrow month name "M" could be March or May, so any attempt to parse it would be ambiguous.

Return

the list of parsable text -- empty if the field is invalid

Parameters

common

field the field to get text for
style the style of the text
locale the locale

common

abstract fun parsableTextFor(field: DateTimeField, styles: Set<TextStyle>, locale: Locale): ParsableTextList

Get a list of all localized text in a set of styles along with the values associated that text. The list will be sorted in descending order by the length of text, making it suitable for parsing.

Any text with conflicting values will be excluded. For example, the English narrow month name "M" could be March or May, so any attempt to parse it would be ambiguous.

Return

the list of parsable text -- empty if the field is invalid or no styles are specified

Parameters

common

field the field to get text for
styles the set of styles to include
locale the locale