Class DateBox.DefaultFormat

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(DateBox box, java.util.Date date)
      Formats the provided date.
      DateTimeFormat getDateTimeFormat()
      Gets the date time format.
      java.util.Date parse​(DateBox dateBox, java.lang.String dateText, boolean reportError)
      Parses the provided string as a date.
      void reset​(DateBox dateBox, boolean abandon)
      If the format did any modifications to the date box's styling, reset them now.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFormat

        public DefaultFormat()
        Creates a new default format instance.
    • Method Detail

      • format

        public java.lang.String format​(DateBox box,
                                       java.util.Date date)
        Description copied from interface: DateBox.Format
        Formats the provided date. Note, a null date is a possible input.
        Specified by:
        format in interface DateBox.Format
        Parameters:
        box - the date box you are formatting
        date - the date to format
        Returns:
        the formatted date as a string
      • getDateTimeFormat

        public DateTimeFormat getDateTimeFormat()
        Gets the date time format.
        Returns:
        the date time format
      • parse

        public java.util.Date parse​(DateBox dateBox,
                                    java.lang.String dateText,
                                    boolean reportError)
        Description copied from interface: DateBox.Format
        Parses the provided string as a date.
        Specified by:
        parse in interface DateBox.Format
        Parameters:
        dateBox - the date box
        dateText - the string representing a date
        reportError - should the formatter indicate a parse error to the user?
        Returns:
        the date created, or null if there was a parse error
      • reset

        public void reset​(DateBox dateBox,
                          boolean abandon)
        Description copied from interface: DateBox.Format
        If the format did any modifications to the date box's styling, reset them now.
        Specified by:
        reset in interface DateBox.Format
        Parameters:
        dateBox - the date box
        abandon - true when the current format is being replaced by another