Package org.apache.guacamole.form
Class DateField
java.lang.Object
org.apache.guacamole.form.Field
org.apache.guacamole.form.DateField
Represents a date field. The field may contain only date values which
conform to a standard pattern, defined by DateField.FORMAT.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.guacamole.form.Field
Field.Type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.guacamole.form.Field
getName, getOptions, getType, setName, setOptions, setType
-
Field Details
-
FORMAT
The date format used by date fields, compatible with SimpleDateFormat.- See Also:
-
-
Constructor Details
-
DateField
Creates a new DateField with the given name.- Parameters:
name
- The unique name to associate with this field.
-
-
Method Details
-
format
Converts the given date into a string which follows the format used by date fields.- Parameters:
date
- The date value to format, which may be null.- Returns:
- The formatted date, or null if the provided time was null.
-
parse
Parses the given string into a corresponding date. The string must follow the standard format used by date fields, as defined by FORMAT and as would be produced by format().- Parameters:
dateString
- The date string to parse, which may be null.- Returns:
- The date corresponding to the given date string, or null if the provided date string was null or blank.
- Throws:
ParseException
- If the given date string does not conform to the standard format used by date fields.
-