Unverified Commit 4db9e942 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(subscription) Hide time for start/end date

issue #6152
Showing with 7 additions and 4 deletions
+7 -4
......@@ -348,9 +348,12 @@ class DateTimeAttribute extends CompositeAttribute
*/
class GeneralizedTimeDisplayAttribute extends GeneralizedTimeDateAttribute
{
function __construct (string $label, string $description, string $ldapName, bool $required, $defaultValue = '', $min = NULL, $max = NULL, string $acl = '')
protected $displayFormat;
function __construct (string $label, string $description, string $ldapName, bool $required, $defaultValue = '', $format = 'Y-m-d, H:i:s', $min = NULL, $max = NULL, string $acl = '')
{
parent::__construct($label, $description, $ldapName, $required, $defaultValue, $min, $max, $acl);
$this->displayFormat = $format;
}
function getValue ()
......@@ -365,7 +368,7 @@ class GeneralizedTimeDisplayAttribute extends GeneralizedTimeDateAttribute
}
$date = $this->getDateValue();
$date->setTimezone(timezone::getDefaultTimeZone());
return htmlescape($date->format('Y-m-d, H:i:s'));
return htmlescape($date->format($this->displayFormat));
}
}
......
......@@ -79,12 +79,12 @@ class subscriptionInfo extends simplePlugin
new GeneralizedTimeDisplayAttribute(
_('Start date'), _('Start date of this subscription'),
'fdSubscriptionStartDate', TRUE,
''
'', 'Y-m-d'
),
new GeneralizedTimeDisplayAttribute(
_('End date'), _('End date of this subscription'),
'fdSubscriptionEndDate', TRUE,
''
'', 'Y-m-d'
),
new FileAttribute(
_('Import'), _('Import subscription'),
......
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