mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Portal : Finished integration of Date & DateTime attributes in forms
SVN:trunk[4031]
This commit is contained in:
@@ -3643,9 +3643,17 @@ class AttributeDateTime extends AttributeDBField
|
||||
*/
|
||||
public function MakeFormField(DBObject $oObject, $oFormField = null)
|
||||
{
|
||||
$oFormField = parent::MakeFormField($oObject, $oFormField);
|
||||
if ($oFormField === null)
|
||||
{
|
||||
$sFormFieldClass = static::GetFormFieldClass();
|
||||
$oFormField = new $sFormFieldClass($this->GetCode());
|
||||
}
|
||||
$oFormField->SetPHPDateTimeFormat((string) $this->GetFormat());
|
||||
$oFormField->SetJSDateTimeFormat($this->GetFormat()->ToMomentJS());
|
||||
|
||||
$oFormField = parent::MakeFormField($oObject, $oFormField);
|
||||
|
||||
// After call to the parent as it sets the current value
|
||||
$oFormField->SetCurrentValue($this->GetFormat()->Format($oObject->Get($this->GetCode())));
|
||||
|
||||
return $oFormField;
|
||||
|
||||
Reference in New Issue
Block a user