DateTimeTextProvider

An abstraction that allows localized date-time text to be supplied from different data sources.

interface DateTimeTextProvider

Types

Companion
Link copied to clipboard
common
object Companion : DateTimeTextProvider

Functions

amPmTextFor
Link copied to clipboard
common

Get the localized AM/PM text.

open fun amPmTextFor(value: Long, locale: Locale): String?
dayOfWeekTextFor
Link copied to clipboard
common

Get the localized day of the week text for a given ISO day of week number.

open fun dayOfWeekTextFor(value: Long, style: TextStyle, locale: Locale): String?
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
eraTextFor
Link copied to clipboard
common

Get the localized ISO era text.

open fun eraTextFor(value: Long, style: TextStyle, locale: Locale): String?
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
monthTextFor
Link copied to clipboard
common

Get the localized month text for a given ISO month number.

open fun monthTextFor(value: Long, style: TextStyle, locale: Locale): String?
parsableTextFor
Link copied to clipboard
common

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.

open fun parsableTextFor(field: DateTimeField, style: TextStyle, locale: Locale): List<Pair<String, Long>>

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.

abstract fun parsableTextFor(field: DateTimeField, styles: Set<TextStyle>, locale: Locale): List<Pair<String, Long>>
textFor
Link copied to clipboard
common

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

open fun textFor(field: DateTimeField, value: Long, style: TextStyle, locale: Locale): String?
toString
Link copied to clipboard
common
open override fun toString(): String

Inheritors

DateTimeTextProvider
Link copied to clipboard
common
PlatformDateTimeTextProvider
Link copied to clipboard