spring-framework / org.springframework.format.datetime.joda / JodaTimeFormatterRegistrar

JodaTimeFormatterRegistrar

open class JodaTimeFormatterRegistrar : FormatterRegistrar

Configures Joda-Time's formatting system for use with Spring.

NOTE: Spring's Joda-Time support requires Joda-Time 2.x, as of Spring 4.0.

Author
Keith Donald

Author
Juergen Hoeller

Author
Phillip Webb

Since
3.1

See Also
#setDateStyle#setTimeStyle#setDateTimeStyle#setUseIsoFormatFormatterRegistrar#registerFormattersorg.springframework.format.datetime.DateFormatterRegistrarDateTimeFormatterFactoryBean

Constructors

<init>

JodaTimeFormatterRegistrar()

Functions

registerFormatters

open fun registerFormatters(registry: FormatterRegistry): Unit

setDateFormatter

open fun setDateFormatter(formatter: DateTimeFormatter): Unit

Set the formatter that will be used for objects representing date values.

This formatter will be used for the LocalDate type. When specified the dateStyle and useIsoFormat properties will be ignored.

setDateStyle

open fun setDateStyle(dateStyle: String): Unit

Set the default format style of Joda LocalDate objects. Default is DateTimeFormat#shortDate().

setDateTimeFormatter

open fun setDateTimeFormatter(formatter: DateTimeFormatter): Unit

Set the formatter that will be used for objects representing date and time values.

This formatter will be used for LocalDateTime, ReadableInstant, Date and Calendar types. When specified the dateTimeStyle and useIsoFormat properties will be ignored.

setDateTimeStyle

open fun setDateTimeStyle(dateTimeStyle: String): Unit

Set the default format style of Joda LocalDateTime and DateTime objects, as well as JDK Date and Calendar objects. Default is DateTimeFormat#shortDateTime().

setTimeFormatter

open fun setTimeFormatter(formatter: DateTimeFormatter): Unit

Set the formatter that will be used for objects representing time values.

This formatter will be used for the LocalTime type. When specified the timeStyle and useIsoFormat properties will be ignored.

setTimeStyle

open fun setTimeStyle(timeStyle: String): Unit

Set the default format style of Joda LocalTime objects. Default is DateTimeFormat#shortTime().

setUseIsoFormat

open fun setUseIsoFormat(useIsoFormat: Boolean): Unit

Set whether standard ISO formatting should be applied to all date/time types. Default is "false" (no).

If set to "true", the "dateStyle", "timeStyle" and "dateTimeStyle" properties are effectively ignored.