Custom entity datetime field definition I created an entity in a module, using code. I generated skeletons with drupal console generate:entity:content (without bundles), and then added a datetime field to my TestFieldEntityItem.php, in baseFieldDefinitions().

$fields['test_date_incode'] = BaseFieldDefinition::create('datetime')
  -&gt;setLabel(t('Test date'))
  -&gt;setDescription(t('Test.'))
  -&gt;setRevisionable(TRUE)
  -&gt;setSettings([
    'datetime_type' =&gt; 'date'
  ])
  -&gt;setDefaultValue('')
  -&gt;setDisplayOptions('view', [
    'label' =&gt; 'above',
    'type' =&gt; 'datetime_default',
    'settings' =&gt; [
      'format_type' =&gt; 'medium',
    ],
    'weight' =&gt; 14,
  ])
  -&gt;setDisplayOptions('form', [
    'type' =&gt; 'datetime',
    'weight' =&gt; 14,
  ])
  -&gt;setDisplayConfigurable('form', TRUE)
  -&gt;setDisplayConfigurable('view', TRUE);


I can add data to my entity, without problem, but if I want to add another field (a simple text field) through the UI, I get this error:


  Un problème est survenu à la création du champ test_text : The "datetime" plugin does not exist.


(In English, the error message is A problem occurred creating field test_text: The "datetime" plugin does not exist.)

The field is created, but I don't like this error. It seems my code to create the datetime field is not the right one.
I use the Calendar module, if this could have any incidence.
Hard to tell which plugin is missing. A guess would be it is a missing field widget plugin which causes the error when you try to add a new field to the default form mode. Then change the plugin name to something like this:

  -&gt;setDisplayOptions('form', [
    'type' =&gt; 'datetime_default',


If this is not the error, then provide a full error message with a backtrace.