Example #1
0
 public function __construct($spec, $aOptions = array())
 {
     if (isset($aOptions['ajax'])) {
         $this->_ajax = $aOptions['ajax'];
         unset($aOptions['ajax']);
     }
     $this->setJqueryParams(array('dateFormat' => "dd/mm/yy", 'firstDay' => 1))->addValidator(new Zend_Validate_Date(array('format' => "dd/mm/yy")));
     parent::__construct($spec, $aOptions);
 }
Example #2
0
 /**
  * Constructor
  *
  * $spec may be:
  * - string: name of element
  * - array: options with which to configure element
  * - Zend_Config: Zend_Config with options for configuring element
  *
  * @param  string|array|Zend_Config $spec
  * @return void
  * @throws Zend_Form_Exception if no element name after initialization
  */
 public function __construct($spec, $options = null)
 {
     parent::__construct($spec, $options);
     if (!empty($options['jquery.params'])) {
         $this->jQueryParams = $options['jquery.params'];
     }
     switch (Zend_Registry::get('languageID')) {
         case '1':
             $this->getView()->jQuery()->addJavascriptFile("{$this->getView()->baseUrl()}/js/jquery/localizations/ui.datepicker-fr.js");
             break;
         case '2':
             $this->getView()->jQuery()->addJavascriptFile("{$this->getView()->baseUrl()}/js/jquery/localizations/ui.datepicker-en.js");
             break;
         default:
             $this->getView()->jQuery()->addJavascriptFile("{$this->getView()->baseUrl()}/js/jquery/localizations/ui.datepicker-fr.js");
             break;
     }
 }