How can I change the selectable years in a date field? I have a date field, birthday, created with the Date module. By default, the selectable years are 1900-2050.  This makes no sense for birthdays so I want to change it to only show years from 1900-(current year-18).

How can I do this?

There is a solution for Drupal 7 but that code does not work in Drupal 8 because form_process_date() does not exist in Drupal 8.

This is the full error:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'form_process_date' not found or invalid function name in Drupal\Core\Form\FormBuilder-&gt;doBuildForm() (line 993 of core/lib/Drupal/Core/Form/FormBuilder.php).


Here is the code I'm using:

function mymodule_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['account']['birthday']['#process'] = array('form_process_date', 'mymodule_fix_year_range');
@mpdonadio♦'s answer provides the explanation.  Here is the actual code I used: 

function mymodule_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['field_birthday']['widget'][0]['value']['#date_year_range'] = '1950:2005';