I am suddenly stricken with an unacceptable default date range value, which I understand is now 1900 to 2000 or so.  The vast number of entries I have made over the years begin in the 1800's and only a few extend past 1900.  I'm not sure when this happened but possible from migrating from version 10 to version 11.  Is there a "universal" setting for this default value?  I've seen mention the need to use hook_form_alter().  I'm not a programmer so I'm not clear on how to do this and if it would be necessary for me to change all the forms I have that have date fields.

My problem is that I can not edit any nodes that contain a date value even if this modification has nothing to do with the date value.

Comments

scottholmes’s picture

I found some code that avoids the problem but I'm still curious as to where this default value of 1900:2050 comes from.  The nodes effected have been created over several years up to fairly recently without any problem.  So this is a new issue.  Anyway by creating a new custom module with this code:

function daterange_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['field_entry_date']['widget'][0]['value']['#date_year_range'] = '1800:2005';
}

Allows me to edit the nodes involved