Package io.goobi.viewer.faces.converters
Class LocalDateTimeConverter
java.lang.Object
io.goobi.viewer.faces.converters.LocalDateTimeConverter
- All Implemented Interfaces:
Converter<LocalDateTime>
JSF
Converter that converts between LocalDateTime objects and their locale- and
timezone-aware string representations for use in UI form components.-
Field Summary
Fields inherited from interface jakarta.faces.convert.Converter
DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAsObject(FacesContext context, UIComponent component, String submittedValue) getAsString(FacesContext context, UIComponent component, LocalDateTime ldt)
-
Constructor Details
-
LocalDateTimeConverter
public LocalDateTimeConverter()
-
-
Method Details
-
getAsObject
public LocalDateTime getAsObject(FacesContext context, UIComponent component, String submittedValue) - Specified by:
getAsObjectin interfaceConverter<LocalDateTime>- Parameters:
context- the current JSF faces contextcomponent- the UI component this converter is attached tosubmittedValue- the string value submitted from the UI form field- Returns:
- the parsed LocalDateTime in UTC, or null if the submitted value is null or empty
-
getAsString
- Specified by:
getAsStringin interfaceConverter<LocalDateTime>- Parameters:
context- the current JSF faces contextcomponent- the UI component this converter is attached toldt- the LocalDateTime value to convert to a string- Returns:
- the formatted date-time string, or an empty string if
ldtis null
-