mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Move DateField->placeholders to subclass
It’s only used there
This commit is contained in:
parent
4b79940368
commit
ac6d4f3038
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user