I have a custom entity with a datetime field. This datetime is saved in the database as an ISO string. I would like to use Views on this entity, and select entities with dates before, after, or between certain dates. I see if I make a view against the system log, these options are presented when filtering on Timestamp. How can I enable the same filtering options on my field?
The field definition is:
$fields['set_datetime'] = BaseFieldDefinition::create('datetime')
->setLabel(t('Set DateTime'))
->setDescription(t('Date and time fermentor was set.'))
->setSettings(array(
'datetime_type' => 'datetime',
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);