Class VTime
java.lang.Object
fc.web.forms.FieldValidator
fc.web.forms.VTime
Validates a time entered in a text box. Typical examples may
look like: 1:23 pm, 1 am, 1:00 am,
and 01:23 pm (with or without "am/pm" as part of the
entered text). By default, all of the above patterns are allowed and
the space between the time and "am/pm" is optional. This can be
changed via the
useAM_PM
and allowSpaceBeforeAM_PM(boolean)
methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
allowSpaceBeforeAM_PM
(boolean allow) void
useAM_PM
(boolean useAM_PM) boolean
Works with any field that returns a String via it'sinvalid reference
Field#getValue
Methods inherited from class FieldValidator
getErrorMessage, getField
-
Constructor Details
-
VTime
-
-
Method Details
-
useAM_PM
-
allowSpaceBeforeAM_PM
-
validate
Works with any field that returns a String via it'sinvalid reference
Field#getValue
If validation succeeds, this method puts the parsed date in the specified form data as the validated value for the target field. This saves the hassle of reparsing the text when (typically) retrieving it later to save the value out to the database.
- Specified by:
validate
in classFieldValidator
- Throws:
ClassCastException
- If the field'sinvalid reference
Field#getValue
-