Esempio n. 1
0
 /**
  * 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());
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
File: Date.php Progetto: jager/cms
 /**
  * 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);
     }
 }
Esempio n. 4
0
 /**
  * Set necessary locale information for validating.
  *
  */
 public function __construct()
 {
     parent::__construct(Zend_Date::DATE_MEDIUM, 'de');
 }
Esempio n. 5
0
 /**
  * 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";
 }