FormField
|
+--TimeField
public class TimeField
extends FormField
Field Summary | |
---|---|
mixed | The AM/PM field. |
mixed | The date format used when displaying the time to the user. |
mixed | The latest time permitted in the form of a time string defined by PHP's strtotime() function. |
mixed | The hour field. |
mixed | The minute field. |
mixed | The earliest time permitted in the form of a time string defined by PHP's strtotime() function. |
Fields inherited from FORMfields.fields.FormField | |
---|---|
autoPropagate, data, disableEnterHandler, displayValuesOnNewLine, editable, enabled, endingString, enterTabHandler, enterTabs, error, extraHtml, fieldBelowLabel, formError, help, hidden, htmlify, id, isData, label, labelForId, multiValues, name, required, subFieldDisplayValueSeparator, subFieldSeparator, subFieldValueSeparator, subFields, subFieldsCannotBeEmpty, trimWhitespace, validators, value, valueIsHtml |
Constructor Summary | |
---|---|
TimeField(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the) Creates a new TimeField. |
|
__construct(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the) Creates a new TimeField. |
Method Summary | |
---|---|
void | Returns the 24 hour value of this field's time value. |
void | Sets this field's value to the current time. |
string | Returns the date formatted by the dateFormat. |
string | Returns the HTML used to display the input portion of this field. |
int | Returns the time as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). |
string | getValue() Returns the value of this form field in the form "HH:MM:00". |
boolean | isValid() Checks for field errors detected by this field, including a check for blank. |
void | setTime(array date) Sets this field's value according to the date array returned by PHP's getdate() function. |
void | Sets this field's value to the current time. |
void | setValue(string value) Sets the value of this form field. |
public mixed $amPm = null
The AM/PM field.
public mixed $dateFormat = "g:i A"
The date format used when displaying the time to the user. See PHP's date function for all the supported formats.
public mixed $endTimeString = null
The latest time permitted in the form of a time string defined by PHP's strtotime() function. For example, "6:00 PM".
public mixed $hour = null
The hour field.
public mixed $min = null
The minute field.
public mixed $startTimeString = null
The earliest time permitted in the form of a time string defined by PHP's strtotime() function. For example, "8:53 AM".
public TimeField(string name, string label, int required, mixed startTimeString, mixed endTimeString, string the)
Creates a new TimeField.
public void get24Hour()
Returns the 24 hour value of this field's time value.
public void getCurrentTime()
Sets this field's value to the current time.
public string getDisplayValue()
Returns the date formatted by the dateFormat.
public string getEditableFieldTag()
Returns the HTML used to display the input portion of this field.
public int getUnixTimestamp()
Returns the time as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). The date in the timestamp is equal to the current date.
public string getValue()
Returns the value of this form field in the form "HH:MM:00".
public boolean isValid()
Checks for field errors detected by this field, including a check for blank. This method ensures that the time is in the valid time range, if a range was specified. If an error is detected, the setError() method is called to set the appropriate error message.
public void setTime(array date)
Sets this field's value according to the date array returned by PHP's getdate() function.
public void setToCurrentTime()
Sets this field's value to the current time.
public void setValue(string value)
Sets the value of this form field.
TimeField a field for 12 hour time.