Class MCRDateConverter

java.lang.Object
org.mycore.frontend.xeditor.validation.MCRDateConverter

public class MCRDateConverter extends Object
Helper for date validators to convert string input into a date value.
Author:
Frank Lützenkirchen
  • Constructor Details

    • MCRDateConverter

      public MCRDateConverter(String patterns)
      Parameters:
      patterns - a list of allowed SimpleDateFormat patterns separated by ";"
  • Method Details

    • getDateFormat

      protected SimpleDateFormat getDateFormat(String pattern)
    • string2date

      public Date string2date(String input) throws MCRException
      Parameters:
      input - the text string
      Returns:
      the parsed Date matching one of the allowed date patterns, or null if the text can not be parsed
      Throws:
      MCRException