$configuration['field_definition'
],
$configuration['settings'
],
$configuration['third_party_settings'
],
$container->
get('entity_type.manager'
)->
getStorage('date_format'
) );
} /**
* {@inheritdoc}
*/
public function formElement(FieldItemListInterface
$items,
$delta, array
$element, array &
$form, FormStateInterface
$form_state) { $element = parent::
formElement($items,
$delta,
$element,
$form,
$form_state);
// If the field is date-only, make sure the title is displayed. Otherwise,
// wrap everything in a fieldset, and the title will be shown in the legend.
if ($this->
getFieldSetting('datetime_type'
) === DateTimeItem::DATETIME_TYPE_DATE
) { $element['value'
]['#title'
] =
$this->fieldDefinition->
getLabel();
$element['value'
]['#description'
] =
$this->fieldDefinition->
getDescription();
} else { $element['#theme_wrappers'
][] = 'fieldset';
}