Class LocalDateTimeConverter

java.lang.Object
io.goobi.viewer.faces.converters.LocalDateTimeConverter
All Implemented Interfaces:
Converter<LocalDateTime>

public class LocalDateTimeConverter extends Object implements Converter<LocalDateTime>
JSF Converter that converts between LocalDateTime objects and their locale- and timezone-aware string representations for use in UI form components.
  • Constructor Details

    • LocalDateTimeConverter

      public LocalDateTimeConverter()
  • Method Details

    • getAsObject

      public LocalDateTime getAsObject(FacesContext context, UIComponent component, String submittedValue)
      Specified by:
      getAsObject in interface Converter<LocalDateTime>
      Parameters:
      context - the current JSF faces context
      component - the UI component this converter is attached to
      submittedValue - 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

      public String getAsString(FacesContext context, UIComponent component, LocalDateTime ldt)
      Specified by:
      getAsString in interface Converter<LocalDateTime>
      Parameters:
      context - the current JSF faces context
      component - the UI component this converter is attached to
      ldt - the LocalDateTime value to convert to a string
      Returns:
      the formatted date-time string, or an empty string if ldt is null