made activity date and time field configurable
This commit is contained in:
parent
88cd511d9f
commit
f9d4820ac2
@ -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'))
|
||||
|
Reference in New Issue
Block a user