Form: Properly preserve defaults from DateTimePicker elements

fixes #3612
This commit is contained in:
Johannes Meyer 2019-04-10 10:50:29 +02:00
parent fc99865241
commit 3fe810ecf9
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Web;
use Icinga\Web\Form\Element\DateTimePicker;
use Zend_Config;
use Zend_Form;
use Zend_Form_Element;
@ -983,7 +984,9 @@ class Form extends Zend_Form
'tag' => 'input',
'type' => 'hidden',
'name' => $name . static::DEFAULT_SUFFIX,
'value' => $el->getValue()
'value' => $el instanceof DateTimePicker
? $el->getValue()->format($el->getFormat())
: $el->getValue()
)
);