API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...
Enter a descriptive title (above) relating to class Date, then describe the problem you have found:
In the example that is provided, there is a missing ' in the default_value.
$form['expiration'] = [
'#type' => 'date',
'#title' => $this->t('Content expiration'),
'#default_value' => 2020-02-05',
];
Should be:
$form['expiration'] = [
'#type' => 'date',
'#title' => $this->t('Content expiration'),
'#default_value' => '2020-02-05',
];
Patch provided for code. Documentation page should be updated also.
Comments
Comment #2
cindytwilliams commentedPatch applied cleanly and added the missing ' to the default value in the example. Screenshots attached. Marking RTBC.
Comment #3
alexpott@cindytwilliams thank you for reviewing this issue! The automated testing infrastructure tells us whether the patch applies, so we do not need people to review that.
Committed and pushed 683dda01d7 to 8.8.x and f2d39d5d3b to 8.7.x. Thanks!