$this->getDocument()->hasRequestData($this->getPrefixedId())
&& \is_string($this->getDocument()->getRequestData($this->getPrefixedId()))
) {
- $this->value = $this->getDocument()->getRequestData($this->getPrefixedId());
+ $value = $this->getDocument()->getRequestData($this->getPrefixedId());
+ $this->value = $value;
if ($this->value === '') {
$this->value = null;
+ } elseif ($this->getValueDateTimeObject() === null) {
+ try {
+ $this->value($value);
+ } catch (\InvalidArgumentException $e) {
+ $this->value = null;
+ }
}
}