- π¦πΊAustralia mstrelan
Maybe this is outdated, I couldn't reproduce in 11.x. Added the following to
\Drupal\system\Form\SiteInformationForm
, as per the documentation in\Drupal\Core\Render\Element\Date
.$form['expiration'] = [ '#type' => 'date', '#title' => $this->t('Content expiration'), '#default_value' => '2020-02-15', ];
This produced the following markup:
<input type="date" data-drupal-selector="edit-expiration" id="edit-expiration" name="expiration" value="2020-02-15" class="form-date form-element form-element--type-date form-element--api-date"/>