Creates a new TFormDateTime element (multi-combobox based date/time field).
TFormDateTime
TFormDateTime
(string $name, string $displayname, string $class, bool $required, [array $yearrange = array(100,0)], [int $monthnames = null], [bool $hr24 = false], [bool $seconds = true], [int $value = ""], [bool $store = true])
-
string
$name: The name of the element. This should correspond to the field names if using with TDBForm, and should not include any spaces or special characters.
-
string
$displayname: The name that should show up to the user for this field.
-
string
$class: The HTML Class to use for the element
-
bool
$required: True if the field has to be filled in
-
array
$yearrange: The range of years to display. This can be used two different ways: array(subtract,add), ie: array(100,0) specifies to show 100 years before the current year, up to the current year. The second way is to specify array("min"=>min,"max"=>max), ie: array("min"=>2000,"max"=>2010) will show from 2000 to 2010, regardless of the current year.
-
int
$monthnames: An array of all the names to use for the months, indexed starting at 1. If null, a default of the full English month name is used (ie "January", "September", etc)
-
bool
$hr24: True if a 24-hour time should be used, or false to display an am/pm box
-
bool
$seconds: True to display a seconds field
-
int
$value: The initial value for the field. Note if using a TDBForm this value will be overridden by loadValues so it is effectively only the default for new entries.
-
bool
$store: Whether this value is persistent. Used by TDBForm to decide to save/load this value from database.
Returns a textual description of the current value
A
getValue
([$display $display = false])
-
$display
$display: True if the value is going to be used for display
Redefinition of:
- TFormElement::getValue()
- Returns a textual description of the current value
Redefined in descendants as:
void
output
()
Redefinition of:
- TFormElement::output()
- Outputs the HTML for this tag
Redefined in descendants as:
Sets the value of the field
true
setValue
(mixed $value)
-
mixed
$value: The value to set
Redefinition of:
- TFormElement::setValue()
- Sets the value of the field
Redefined in descendants as:
void
validate
()
Redefinition of:
- TFormElement::validate()
- Validates the data in this field.
Redefined in descendants as:
Inherited Methods
Inherited From TFormElement
TFormElement::TFormElement()
TFormElement::getValue()
TFormElement::output()
TFormElement::setParent()
TFormElement::setValue()
TFormElement::validate()