addValidator('Date', false, ['format' => 'Y-m-d']); $this->getValidator('Date')->setMessage('Date is in wrong format', Zend_Validate_Date::FALSEFORMAT); } public function getFormat() { return $this->_format; } public function setFormat($format) { $this->_format = (string) $format; return $this; } public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return; } $decorators = $this->getDecorators(); if (empty($decorators)) { $this->addDecorator('JQuery_Datepicker') ->addDecorator('Errors') ->addDecorator('Description', array('tag' => 'p', 'class' => 'description')) ->addDecorator('HtmlTag', array('tag' => 'dd', 'id' => $this->getName() . '-element')) ->addDecorator('Label', array('tag' => 'dt')); } } public function setValue($value) { return parent::setValue(empty($value) ? null : $value); } }