FormField
|
+--DateTimeField
public class DateTimeField
extends FormField
Field Summary | |
---|---|
mixed | The date sub field. |
mixed | The date format used when displaying value of this date to the user. |
mixed | The latest date and time permitted in the form: "YYYY-MM-DD HH:MM:SS", "YYYY-MM-DD HH:MM" or "YYYYMMDDHHMMSS" |
mixed | The earliest date and time permitted in the form: "YYYY-MM-DD HH:MM:SS", "YYYY-MM-DD HH:MM" or "YYYYMMDDHHMMSS" |
mixed | The string used to separate parts of the field. |
mixed | A string separator used to separate the values of the sub fields. |
mixed | The time sub field. |
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 | |
---|---|
DateTimeField(string name, string label, int required, string blankString, string startDateTimeString, string endDateTimeString) Creates a new DateTimeField. |
|
__construct(string name, string label, int required, string blankString, string startDateTimeString, string endDateTimeString) Creates a new DateTimeField. |
Method Summary | |
---|---|
void | Sets this field's value to the current date and time. |
string | Returns the date formatted by the dateFormat. |
int | Returns the date and time as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). |
boolean | isValid() Checks for field errors detected by this field, including a check for blank. |
void | Sets this field's value to the current date and time. |
void | setValue(string value) Sets the value of this form field. |
public mixed $date = null
The date sub field.
public mixed $dateFormat = "n/j/Y g:i A"
The date format used when displaying value of this date to the user. See PHP's date function for all the supported formats.
public mixed $endDateTimeString = null
The latest date and time permitted in the form: "YYYY-MM-DD HH:MM:SS", "YYYY-MM-DD HH:MM" or "YYYYMMDDHHMMSS"
public mixed $startDateTimeString = null
The earliest date and time permitted in the form: "YYYY-MM-DD HH:MM:SS", "YYYY-MM-DD HH:MM" or "YYYYMMDDHHMMSS"
public mixed $subFieldSeparator = " "
The string used to separate parts of the field.
public mixed $subFieldValueSeparator = " "
A string separator used to separate the values of the sub fields.
public mixed $time = null
The time sub field.
public DateTimeField(string name, string label, int required, string blankString, string startDateTimeString, string endDateTimeString)
Creates a new DateTimeField.
public void getCurrentDateTime()
Sets this field's value to the current date and time.
public string getDisplayValue()
Returns the date formatted by the dateFormat.
public int getUnixTimestamp()
Returns the date and time as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
public boolean isValid()
Checks for field errors detected by this field, including a check for blank. This method ensures that the date is valid and that it falls within the permissible range, if a date range was specified. If an error is detected, the setError() method is called to set the appropriate error message.
public void setToCurrentDateTime()
Sets this field's value to the current date and time.
public void setValue(string value)
Sets the value of this form field.
FormField is the base class of a form field.