Provides a form element for date selection.
Properties:
#default_value: An array with the keys: 'year', 'month', and 'day'. Defaults to the current date if no value is supplied.
$form['expiration'] = array(
'#type' => 'date',
'#title' => $this->t('Content expiration'),
'#default_value' => array('year' => 2020, 'month' => 2, 'day' => 15,)
);
Plugin annotation
@FormElement("date")
Hierarchy
class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionIn