Unverified Commit 916e6681 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:tractor: feat(simpleplugin) Move GeneralizedTimeDisplayAttribute from audit to core

issue #6152
Showing with 18 additions and 0 deletions
+18 -0
......@@ -309,3 +309,21 @@ class DateTimeAttribute extends CompositeAttribute
parent::__construct($description, $ldapName, $attributes, '/^(\d{8})(\d{6})$/', '%s%s', $acl, $label);
}
}
/*!
* \brief Read-only GeneralizedTimeDateAttribute. Used by audit plugin
*/
class GeneralizedTimeDisplayAttribute extends GeneralizedTimeDateAttribute
{
function getValue ()
{
return $this->computeLdapValue();
}
function renderFormInput ()
{
$date = $this->getDateValue();
$date->setTimezone(timezone::getDefaultTimeZone());
return htmlentities($date->format('Y-m-d, H:i:s'), ENT_COMPAT, 'UTF-8');
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment