made activity date and time field configurable

This commit is contained in:
naomi 2021-11-16 07:05:07 +00:00
parent 88cd511d9f
commit f9d4820ac2

View File

@ -225,25 +225,14 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte
$fields['activity_date_time'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Date and time'))
->setRevisionable(TRUE)
->setRequired(TRUE)
->setDefaultValueCallback('\Drupal\opencase_entities\Entity\OCActivity::currentDateTime')
->setDisplayConfigurable('form', true)
->setDisplayConfigurable('view', true)
->setSettings([
'datetime_type' => 'date'
])
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'datetime_default',
'settings' => [
'format_type' => 'short',
],
'weight' => -3,
])
->setDisplayOptions('form', [
'type' => 'datetime_default',
'weight' => -3,
]);
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status'))