Move DateField->placeholders to subclass

It’s only used there
This commit is contained in:
Ingo Schommer 2017-03-31 10:36:36 +13:00
parent 4b79940368
commit ac6d4f3038
2 changed files with 29 additions and 29 deletions

View File

@ -85,13 +85,6 @@ class DateField extends TextField
*/
protected $dateLength = null;
/**
* Set whether to show placeholders
*
* @var bool
*/
protected $placeholders = true;
/**
* Override locale for client side.
*
@ -475,28 +468,6 @@ class DateField extends TextField
return $rules;
}
/**
* If placeholders are shown
*
* @return bool
*/
public function getPlaceholders()
{
return $this->placeholders;
}
/**
* Set if placeholders are shown
*
* @param bool $placeholders
* @return $this
*/
public function setPlaceholders($placeholders)
{
$this->placeholders = $placeholders;
return $this;
}
/**
* @return string
*/

View File

@ -15,6 +15,13 @@ class SeparatedDateField extends DateField
*/
protected $separator = '/';
/**
* Set whether to show placeholders
*
* @var bool
*/
protected $placeholders = true;
public function Field($properties = array())
{
// Three separate fields for day, month and year
@ -82,6 +89,28 @@ class SeparatedDateField extends DateField
return $this->separator;
}
/**
* If placeholders are shown
*
* @return bool
*/
public function getPlaceholders()
{
return $this->placeholders;
}
/**
* Set if placeholders are shown
*
* @param bool $placeholders
* @return $this
*/
public function setPlaceholders($placeholders)
{
$this->placeholders = $placeholders;
return $this;
}
/**
* Convert array to timestamp
*