Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Using actual date format settings in DateField/TimeField->vali…

…date() messages (from r107786)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112694 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 171fdd60503d8c375507d1cc6334b6d95bcddbbc 1 parent 40bc9ce
@sminnee sminnee authored
Showing with 4 additions and 2 deletions.
  1. +1 −1  forms/DateField.php
  2. +1 −1  forms/TimeField.php
  3. +2 −0  lang/en_US.php
View
2  forms/DateField.php
@@ -330,7 +330,7 @@ function validate($validator) {
if(!$valid) {
$validator->validationError(
$this->name,
- _t('DateField.VALIDDATEFORMAT', "Please enter a valid date format (DD/MM/YYYY)."),
+ _t('DateField.VALIDDATEFORMAT2', sprintf("Please enter a valid date format (%s).", $this->getConfig('dateformat'))),
"validation",
false
);
View
2  forms/TimeField.php
@@ -146,7 +146,7 @@ function validate($validator) {
if(!Zend_Date::isDate($this->value, $this->getConfig('timeformat'), $this->locale)) {
$validator->validationError(
$this->name,
- _t('DateField.VALIDDATEFORMAT', "Please enter a valid time format."),
+ _t('TimeField.VALIDDATEFORMAT', sprintf("Please enter a valid time format (%s)", $this->getConfig('timeformat'))),
"validation",
false
);
View
2  lang/en_US.php
@@ -152,6 +152,7 @@
$lang['en_US']['DateField']['TODAY'] = 'today';
$lang['en_US']['DateField']['VALIDATIONJS'] = 'Please enter a valid date format (DD/MM/YYYY).';
$lang['en_US']['DateField']['VALIDDATEFORMAT'] = 'Please enter a valid time format.';
+$lang['en_US']['DateField']['VALIDDATEFORMAT2'] = 'Please enter a valid time format (%s)';
$lang['en_US']['DateField']['VALIDDATEMAXDATE'] = 'Your date has to be older or matching the maximum allowed date (%s)';
$lang['en_US']['DateField']['VALIDDATEMINDATE'] = 'Your date has to be newer or matching the minimum allowed date (%s)';
$lang['en_US']['DropdownField']['CHOOSE'] = array(
@@ -810,6 +811,7 @@
$lang['en_US']['TableListField_PageControls.ss']['VIEWLAST'] = 'View last';
$lang['en_US']['TableListField_PageControls.ss']['VIEWNEXT'] = 'View next';
$lang['en_US']['TableListField_PageControls.ss']['VIEWPREVIOUS'] = 'View previous';
+$lang['en_US']['TimeField']['VALIDATEFORMAT'] = 'Please enter a valid time format (%s)';
$lang['en_US']['ToggleCompositeField.ss']['HIDE'] = 'Hide';
$lang['en_US']['ToggleCompositeField.ss']['SHOW'] = 'Show';
$lang['en_US']['ToggleField']['LESS'] = 'less';
Please sign in to comment.
Something went wrong with that request. Please try again.