diff -r bd595ad770fc -r 1c2f13fd785c web/enmi/Zend/Dojo/Form/Element/DateTextBox.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi/Zend/Dojo/Form/Element/DateTextBox.php Thu Jan 20 19:30:54 2011 +0100 @@ -0,0 +1,214 @@ +setConstraint('am,pm', (bool) $flag); + return $this; + } + + /** + * Retrieve am,pm flag + * + * @return bool + */ + public function getAmPm() + { + if (!$this->hasConstraint('am,pm')) { + return false; + } + return ('true' ==$this->getConstraint('am,pm')); + } + + /** + * Set strict flag + * + * @param bool $strict + * @return Zend_Dojo_Form_Element_DateTextBox + */ + public function setStrict($flag) + { + $this->setConstraint('strict', (bool) $flag); + return $this; + } + + /** + * Retrieve strict flag + * + * @return bool + */ + public function getStrict() + { + if (!$this->hasConstraint('strict')) { + return false; + } + return ('true' == $this->getConstraint('strict')); + } + + /** + * Set locale + * + * @param string $locale + * @return Zend_Dojo_Form_Element_DateTextBox + */ + public function setLocale($locale) + { + $this->setConstraint('locale', (string) $locale); + return $this; + } + + /** + * Retrieve locale + * + * @return string|null + */ + public function getLocale() + { + return $this->getConstraint('locale'); + } + + /** + * Set date format pattern + * + * @param string $pattern + * @return Zend_Dojo_Form_Element_NumberTextBox + */ + public function setDatePattern($pattern) + { + $this->setConstraint('datePattern', (string) $pattern); + return $this; + } + + /** + * Retrieve date format pattern + * + * @return string|null + */ + public function getDatePattern() + { + return $this->getConstraint('datePattern'); + } + + /** + * Set numeric format formatLength + * + * @see $_allowedFormatTypes + * @param string $formatLength + * @return Zend_Dojo_Form_Element_NumberTextBox + */ + public function setFormatLength($formatLength) + { + $formatLength = strtolower($formatLength); + if (!in_array($formatLength, $this->_allowedFormatTypes)) { + require_once 'Zend/Form/Element/Exception.php'; + throw new Zend_Form_Element_Exception(sprintf('Invalid formatLength "%s" specified', $formatLength)); + } + + $this->setConstraint('formatLength', $formatLength); + return $this; + } + + /** + * Retrieve formatLength + * + * @return string|null + */ + public function getFormatLength() + { + return $this->getConstraint('formatLength'); + } + + /** + * Set numeric format Selector + * + * @see $_allowedSelectorTypes + * @param string $selector + * @return Zend_Dojo_Form_Element_NumberTextBox + */ + public function setSelector($selector) + { + $selector = strtolower($selector); + if (!in_array($selector, $this->_allowedSelectorTypes)) { + require_once 'Zend/Form/Element/Exception.php'; + throw new Zend_Form_Element_Exception(sprintf('Invalid Selector "%s" specified', $selector)); + } + + $this->setConstraint('selector', $selector); + return $this; + } + + /** + * Retrieve selector + * + * @return string|null + */ + public function getSelector() + { + return $this->getConstraint('selector'); + } +}