Fixes date format in Smart Block tooltip (CC-5618)
This commit is contained in:
parent
7ec664823d
commit
2e970bfc8a
|
@ -510,7 +510,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
} elseif ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
} elseif ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
||||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_value'])) {
|
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_value'])) {
|
||||||
$element->addError(_("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00)"));
|
$element->addError(_("The value should be in timestamp format (e.g. 0000-00-00 or 0000-00-00 00:00:00)"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_value']);
|
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_value']);
|
||||||
|
@ -523,7 +523,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
||||||
|
|
||||||
if (isset($d['sp_criteria_extra'])) {
|
if (isset($d['sp_criteria_extra'])) {
|
||||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_extra'])) {
|
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_extra'])) {
|
||||||
$element->addError(_("The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00)"));
|
$element->addError(_("The value should be in timestamp format (e.g. 0000-00-00 or 0000-00-00 00:00:00)"));
|
||||||
$isValid = false;
|
$isValid = false;
|
||||||
} else {
|
} else {
|
||||||
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_extra']);
|
$result = Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_extra']);
|
||||||
|
|
Loading…
Reference in New Issue