FormField
|
+--DateField
public  class DateField
extends FormField
| Field Summary | |
|---|---|
| mixed | The date format used when displaying value of this date to the user.  | 
| mixed | The day field.  | 
| mixed | The latest date permitted in the form "YYYY-MM-DD"  | 
| mixed | The month field.  | 
| mixed | True if an icon for the popup calendar should be displayed.  | 
| mixed | The earliest date permitted in the form "YYYY-MM-DD"  | 
| mixed | $subFieldDisplayValueSeparator The string used to separate parts of the display value.  | 
| mixed | The year 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 | |
|---|---|
DateField(string name, string label, int required, string blankString, string startDateString, string endDateString) Creates a new DateField.  | 
|
__construct(string name, string label, int required, string blankString, string startDateString, string endDateString) Creates a new DateField.  | 
|
| Method Summary | |
|---|---|
| void | Sets this field's value to the current date.  | 
| int | getDaysInMonth(int month, int year) Returns the number of days in the specified month.  | 
| string | Returns JavaScript code to disable the input field portion of this field during run-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 date 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 "YYYY-MM-DD".  | 
| boolean | isValid() Checks for field errors detected by this field, including a check for blank.  | 
| void | setDate(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 date.  | 
| void | setValue(string value) Sets the value of this form field.  | 
public  mixed $dateFormat = "n/j/Y"
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 $day = null
The day field.
public  mixed $endDateString = null
The latest date permitted in the form "YYYY-MM-DD"
public  mixed $month = null
The month field.
public  mixed $showCalendar = true
True if an icon for the popup calendar should be displayed.
public  mixed $startDateString = null
The earliest date permitted in the form "YYYY-MM-DD"
public  mixed $subFieldDisplayValueSeparator = "-"
The string used to separate parts of the display value.
public  mixed $year = null
The year field.
public DateField(string name, string label, int required, string blankString, string startDateString, string endDateString)
Creates a new DateField.
public  void getCurrentDate()
Sets this field's value to the current date.
public  int getDaysInMonth(int month, int year)
Returns the number of days in the specified month.
public  string getDisableFieldJs()
Returns JavaScript code to disable the input field portion of this field during run-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 date as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
public  string getValue()
Returns the value of this form field in the form "YYYY-MM-DD".
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 setDate(array date)
Sets this field's value according to the date array returned by PHP's getdate() function.
public  void setToCurrentDate()
Sets this field's value to the current date.
public  void setValue(string value)
Sets the value of this form field. Valid formats: YYYY-MM-DD, YYYY-M-D, MM-DD-YYYY. Valid separators: "/", "-", ".".
DateField a three part date field with a popup date calendar.