diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 8b2915e1a..3f05f9863 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -6346,7 +6346,15 @@ class AttributeDateTime extends AttributeDBField $oFormField = parent::MakeFormField($oObject, $oFormField); - return $oFormField; + // After call to the parent as it sets the current value + $oValue = $oObject->Get($this->GetCode()); + if ($oValue === $this->GetNullValue()) { + $oValue = $this->GetDefaultValue($oObject); + } + $oFormField->SetCurrentValue($this->GetFormat()->Format($oValue)); + + + return $oFormField; } /**