mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Disable javascript date validation via DateField->jsValidation() if locale is not 'en_NZ" (which is the only format it validates for). (from r100986)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111558 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
5f0fcc58ec
commit
c54cce8673
@ -37,6 +37,11 @@ require_once 'Zend/Date.php';
|
|||||||
* $f->setLocale('de_DE');
|
* $f->setLocale('de_DE');
|
||||||
* $f->setConfig('dmyfields');
|
* $f->setConfig('dmyfields');
|
||||||
*
|
*
|
||||||
|
* # Validation
|
||||||
|
*
|
||||||
|
* Caution: JavaScript validation is only supported for the 'en_NZ' locale at the moment,
|
||||||
|
* it will be disabled automatically for all other locales.
|
||||||
|
*
|
||||||
* @package forms
|
* @package forms
|
||||||
* @subpackage fields-datetime
|
* @subpackage fields-datetime
|
||||||
*/
|
*/
|
||||||
@ -221,6 +226,9 @@ class DateField extends TextField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function jsValidation() {
|
function jsValidation() {
|
||||||
|
// JavaScript validation of locales other than en_NZ are not supported at the moment...
|
||||||
|
if($this->getLocale() != 'en_NZ') return;
|
||||||
|
|
||||||
$formID = $this->form->FormName();
|
$formID = $this->form->FormName();
|
||||||
|
|
||||||
if(Validator::get_javascript_validator_handler() == 'none') return true;
|
if(Validator::get_javascript_validator_handler() == 'none') return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user