/** * Add a date picker element to the form. * * @see Cible_Form_Element_DatePicker * * @param array $question * * @return void */ private function _addDate($question) { $elemName = $question['FQT_TypeName'] . self::UNDERSCORE . $question['FQ_ElementID']; $options['jquery.params'] = array('changeYear' => true, 'changeMonth' => true); $element = new Cible_Form_Element_DatePicker($elemName, $options); $element->addValidator('Date', true, array('format' => 'dd-mm-yy', 'messages' => array('dateNotYYYY-MM-DD' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateInvalid' => $this->getView()->getCibleText('validation_message_invalid_date'), 'dateFalseFormat' => $this->getView()->getCibleText('validation_message_invalid_date')))); $element->removeDecorator('DtDdWrapper'); $element->addDecorators(array('UiWidgetElement', array('HtmlTag', array('tag' => 'div', 'class' => 'answer-zone')))); $element->setAttrib('class', 'dateTextInput'); $element->setjQueryParam('dateFormat', 'dd-mm-yy'); $this->_addExtras($element, $question); $this->addElement($element); $this->_displayGroupElements[] = $elemName; }