Skip to content

Commit

Permalink
BUGFIX Disable javascript date validation via DateField->jsValidation…
Browse files Browse the repository at this point in the history
…() 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
  • Loading branch information
Sam Minnee committed Oct 4, 2010
1 parent 5f0fcc5 commit c54cce8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions forms/DateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
* $f->setLocale('de_DE');
* $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
* @subpackage fields-datetime
*/
Expand Down Expand Up @@ -221,6 +226,9 @@ function performReadonlyTransformation() {
}

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();

if(Validator::get_javascript_validator_handler() == 'none') return true;
Expand Down

0 comments on commit c54cce8

Please sign in to comment.