Date field Start and End limit
We can do it like this...

$form['my_date'] = array(
  '#type' =&gt; 'date',
  '#date_format' =&gt; 'd-m-y',
  '#default_value' =&gt; format_date($primary_start1, 'custom', $format),
  '#date_type' =&gt; DATE_DATETIME,
  '#date_timezone' =&gt; date_default_timezone(),
  '#date_format' =&gt; 'm/d/Y',
  '#size' =&gt; 20,
  '#access' =&gt; TRUE,
  '#after_build' =&gt; array("custom_range_date")
);


using '#after_build' =&gt; array("custom_range_date")

function custom_range_date($form_element, &amp;$form_state){
    // We unset the current values
    unset($form_element['year']['#options']);

    // Now we set the range we want
    $max_age = date('Y') - 100; // 100 years ago
    $min_age = date('Y') - 7; // 7 years ago

    // Now we populate the array
    $form_element['year']['#options'] = array();
    foreach (range($max_age, $min_age) as $year){
        $form_element['year']['#options'][$year] = $year;
    }

    // We return our modified element
    return $form_element;
}


SEE: https://www.drupal.org/node/1165138