convert attribute of type date into format yyyy-mm-dd

This commit is contained in:
Uwe Steinmann 2022-09-20 08:24:27 +02:00
parent 877a94c37d
commit 4aa38182db

View File

@ -45,6 +45,11 @@ class SeedDMS_Controller_AddSubFolder extends SeedDMS_Controller_Common {
if($attrdef = $dms->getAttributeDefinition($attrdefid)) {
if(null === ($ret = $this->callHook('validateAttribute', $attrdef, $attribute))) {
if($attribute) {
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_date:
$attribute = date('Y-m-d', makeTsFromDate($attribute));
break;
}
if(!$attrdef->validate($attribute, null, true)) {
$this->errormsg = getAttributeValidationError($attrdef->getValidationError(), $attrdef->getName(), $attribute);
return false;