Skip to content

Commit

Permalink
Move DateField->placeholders to subclass
Browse files Browse the repository at this point in the history
It’s only used there
  • Loading branch information
chillu committed Mar 30, 2017
1 parent 3499ebc commit 09cdec8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/Forms/DateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -475,28 +468,6 @@ public function getSchemaValidation()
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
*/
Expand Down
29 changes: 29 additions & 0 deletions src/Forms/SeparatedDateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,6 +89,28 @@ public function getSeparator()
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
*
Expand Down

0 comments on commit 09cdec8

Please sign in to comment.