I’ve Drupal Development Company following datetime discipline definition for my content material entity:
$fields['start_date'] = BaseFieldDefinition::create('datetime') ->setLabel(t('Begin date')) ->setDescription(t('Begin date in GMT time.')) ->setSettings([ 'default_value' => DrupalDateTime::createFromTimestamp(time()), ]) ->setDisplayOptions('view', [ 'label' => 'above', 'type' => 'string', 'weight' => -4, ]) ->setDisplayOptions('kind', [ 'type' => 'datetime_default', 'weight' => -3, ]) ->setDisplayConfigurable('kind', TRUE) ->setDisplayConfigurable('view', TRUE);
Consequently, when creating a brand new entity, I get Drupal Development Company discipline show with out default worth set in a kind. I additionally tried setDefaultValue methodology however with no luck. What’s Drupal Development Company correct option to set Drupal Development Company default values for Drupal Development Company customized content material entities?