/** * Constructs Form_Validate_Date class for validating date input. * @param array $config Configuration options (see Zend_Validate_Date) */ public function __construct($config = null) { parent::__construct($config); // automatically set date format used by Opus $this->setFormat($this->getDateFormat()); $this->setInputPattern($this->getDatePattern()); }
public function __construct($options = array()) { if (isset($options['outputFormat'])) { $format = $options['outputFormat']; unset($options['outputFormat']); } else { $format = '%format%'; } parent::__construct($options); $this->_messageTemplates[self::INVALID] = "Invalid type given, value should be string, integer, array or Zend_Date"; $this->_messageTemplates[self::INVALID_DATE] = trlKwfStatic("'%value%' does not appear to be a valid date"); $this->_messageTemplates[self::FALSEFORMAT] = trlKwfStatic("'%value%' does not fit the date format '{0}'", array($format)); }
/** * Sets validator options * * @return void */ public function __construct($minDate = null, $maxDate = null, $allowEmpty = null, $emptyValue = null, $format = null, $locale = null) { parent::__construct($format, $locale); $dummy = new parent(); $this->setMessages($dummy->_messageTemplates); $this->setMinDate($minDate); $this->setMaxDate($maxDate); if (null !== $allowEmpty) { $this->setAllowEmpty($allowEmpty); } if (null !== $emptyValue) { $this->setEmptyValue($emptyValue); } }
/** * Set necessary locale information for validating. * */ public function __construct() { parent::__construct(Zend_Date::DATE_MEDIUM, 'de'); }
/** * Sets validator options * * @param string $format OPTIONAL * @param string|Zend_Locale $locale OPTIONAL * @return void */ public function __construct($format = null, $locale = null) { parent::__construct($format, $locale); $this->_messageTemplates[self::END_DATE_EARLIER] = "end date is earlier then start date"; }