import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
@ -17,16 +16,14 @@
|
||||
* @package Zend_Validate
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Date.php 12062 2008-10-21 17:28:12Z thomas $
|
||||
* @version $Id: Date.php 13371 2008-12-19 11:41:09Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @see Zend_Validate_Abstract
|
||||
*/
|
||||
require_once 'Zend/Validate/Abstract.php';
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Validate
|
||||
@ -85,7 +82,9 @@ class Zend_Validate_Date extends Zend_Validate_Abstract
|
||||
public function __construct($format = null, $locale = null)
|
||||
{
|
||||
$this->setFormat($format);
|
||||
$this->setLocale($locale);
|
||||
if ($locale !== null) {
|
||||
$this->setLocale($locale);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,22 +105,8 @@ class Zend_Validate_Date extends Zend_Validate_Abstract
|
||||
*/
|
||||
public function setLocale($locale = null)
|
||||
{
|
||||
if ($locale === null) {
|
||||
$this->_locale = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
require_once 'Zend/Locale.php';
|
||||
if (!Zend_Locale::isLocale($locale, true, false)) {
|
||||
if (!Zend_Locale::isLocale($locale, false, false)) {
|
||||
require_once 'Zend/Validate/Exception.php';
|
||||
throw new Zend_Validate_Exception("The locale '$locale' is no known locale");
|
||||
}
|
||||
|
||||
$locale = new Zend_Locale($locale);
|
||||
}
|
||||
|
||||
$this->_locale = (string) $locale;
|
||||
$this->_locale = Zend_Locale::findLocale($locale);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user