FormField
|
+--CreditCardDateField
public class CreditCardDateField
extends FormField
Field Summary | |
---|---|
mixed | The date format used to format this date. |
mixed | The month field. |
mixed | $subFieldDisplayValueSeparator The string used to separate parts of the display value. |
mixed | The string used to separate parts of the field. |
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 | |
---|---|
CreditCardDateField(string name, string label, int required, string blankString, string dateFormat, string startDateString, string endDateString) Creates a new CreditCardDateField. |
|
__construct(string name, string label, int required, string blankString, string dateFormat, string startDateString, string endDateString) Creates a new CreditCardDateField. |
Method Summary | |
---|---|
string | Returns the date formatted by the dateFormat. |
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 | setValue(string value) Sets the value of this form field. |
public mixed $dateFormat = "m/Y"
The date format used to format this date. Formats currently supported: m/y, m/Y, M/y, M/Y, m - M/Y, m - M/y See PHP's date() function for details on the date format.
public mixed $month = null
The month field.
public mixed $subFieldDisplayValueSeparator = "-"
The string used to separate parts of the display value.
public mixed $subFieldSeparator = " - "
The string used to separate parts of the field.
public mixed $year = null
The year field.
public CreditCardDateField(string name, string label, int required, string blankString, string dateFormat, string startDateString, string endDateString)
Creates a new CreditCardDateField.
public string getDisplayValue()
Returns the date formatted by the dateFormat.
public int getUnixTimestamp()
Returns the date as measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). The day is defaulted to the 1st of the month.
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 expiration isn't in the past and that the date range is valid, if a date range was specified. If an error is detected, the setError() method is called to set the appropriate error message.
public void setValue(string value)
Sets the value of this form field.
CreditCardDateField is a date field for credit card expiration dates.