field = $field; } public function getView(): CDateSelector { $view = (new CDateSelector($this->field->getName(), $this->field->getValue())) ->setMaxLength($this->field->getMaxLength()) ->setAriaRequired($this->isRequired()) ->setEnabled(!$this->isDisabled()); if ($this->date_format !== '') { $view->setDateFormat($this->date_format); } if ($this->placeholder !== '') { $view->setPlaceholder($this->placeholder); } return $view; } public function setDateFormat(string $date_format): self { $this->date_format = $date_format; return $this; } public function setPlaceholder(string $placeholder): self { $this->placeholder = $placeholder; return $this; } }