예제 #1
0
 /**
  * Get the value from the request
  * @param string $name name of the request value
  * @return mixed value of this field
  * @throws zibo\library\validation\exception\ValidationException when a invalid date is entered
  */
 protected function getRequestValue($name = null)
 {
     $value = parent::getRequestValue($name);
     if (!$value) {
         return $value;
     }
     try {
         $locale = I18n::getInstance()->getLocale();
         $value = $locale->parseDate($value);
         $value = mktime(0, 0, 0, date('m', $value), date('d', $value), date('Y', $value));
     } catch (Exception $e) {
         $error = new ValidationError('error.date.format', '%value% is not in the right format', array('value' => $value));
         $exception = new ValidationException();
         $exception->addErrors($this->getName(), array($error));
         throw $exception;
     }
     return $value;
 }
예제 #2
0
 public function getNameHtml()
 {
     return parent::getNameHtml();
 }