mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Pass setDescription() through to sub-fields in DatetimeField and PhoneNumberField
This commit is contained in:
parent
dbaf407569
commit
212c427c45
@ -87,7 +87,7 @@ class DatetimeField extends FormField {
|
||||
|
||||
public function Field($properties = array()) {
|
||||
Requirements::css(FRAMEWORK_DIR . '/css/DatetimeField.css');
|
||||
|
||||
|
||||
$tzField = ($this->getConfig('usertimezone')) ? $this->timezoneField->FieldHolder() : '';
|
||||
return $this->dateField->FieldHolder() .
|
||||
$this->timeField->FieldHolder() .
|
||||
@ -236,6 +236,15 @@ class DatetimeField extends FormField {
|
||||
public function getLocale() {
|
||||
return $this->dateField->getLocale();
|
||||
}
|
||||
|
||||
public function setDescription($description) {
|
||||
parent::setDescription($description);
|
||||
|
||||
$this->dateField->setDescription($description);
|
||||
$this->timeField->setDescription($description);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: Use {@link getDateField()} and {@link getTimeField()}
|
||||
|
@ -54,6 +54,9 @@ class PhoneNumberField extends FormField {
|
||||
$field->push(new NumericField( $this->name.'[Extension]', 'ext', $extension, 6));
|
||||
}
|
||||
|
||||
$description = $this->getDescription();
|
||||
if($description) $fields->getChildren()->First()->setDescription($description);
|
||||
|
||||
foreach($fields as $field) {
|
||||
$field->setDisabled($this->isDisabled());
|
||||
$field->setReadonly($this->isReadonly());
|
||||
|
Loading…
x
Reference in New Issue
Block a user