\DropdownDateField
Form field to display an editable date string in three separate dropdown fields for day, month and year.
# Configuration
- 'range': set the range of the Year Drowpdown
- 'dateformat' (string): Date format compatible with Zend_Date.
Usually set to default format for through .
- 'dmyseparator' (string): HTML markup to separate day, month and year fields.
Only applicable with 'dmyfields'=TRUE. Use 'dateformat' to influence date representation with 'dmyfields'=FALSE.
- 'datavalueformat' (string): Internal ISO format string used by to save the
date to a database.
- 'min' (string): Minimum allowed date value (in ISO format, or strtotime() compatible).
Example: '2010-03-31', or '-7 days'
- 'max' (string): Maximum allowed date value (in ISO format, or strtotime() compatible).
Example: '2010-03-31', or '1 year'
# Localization
The field will get its default locale from , and set the `dateformat`
configuration accordingly. Changing the locale through will not update the
`dateformat` configuration automatically.
See http://doc.silverstripe.org/framework/en/topics/i18n for more information about localizing form fields.
# Usage
## Example: German dates with separate fields for day, month, year
$f = new DropdownDateField('MyDate');
$f->setLocale('de_DE');
# Validation
Caution: JavaScript validation is only supported for the 'en_NZ' locale at the moment,
it will be disabled automatically for all other locales.
Synopsis
- // members
- private static array $default_config = ;
- protected $config;
- protected String $locale = NULL;
- protected Zend_Date $valueObj = NULL;
- // methods
- public void __construct()
- public void FieldHolder()
- public void SmallFieldHolder()
- public void Field()
- protected void dropdownYears()
- public void Type()
- public void setValue()
- public void performReadonlyTransformation()
- public Boolean validate()
Hierarchy
Extends
- DateField
Members
Methods
protected
public
- __construct()
- Field()
- FieldHolder()
- SmallFieldHolder()
- Type()
- performReadonlyTransformation()
- setValue() — Sets the internal value to ISO date format.
- validate()