You are here

function _quiz_limit_year_options in Quiz 7

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_limit_year_options()
  2. 6.4 quiz.module \_quiz_limit_year_options()
  3. 7.4 quiz.module \_quiz_limit_year_options()

Limit the year options to the years 1970 - 2030 for form items of type date.

Some systems don't support all the dates the forms api lets you choose from. This function limits the options to dates most systems support.

Parameters

$form_element: Form element of type date.

Return value

Form element with a more limited set of years to choose from.

1 string reference to '_quiz_limit_year_options'
quiz_form in ./quiz.module
Implements hook_form().

File

./quiz.module, line 4141
Quiz Module

Code

function _quiz_limit_year_options($form_element) {
  $form_element['year']['#options'] = drupal_map_assoc(range(1970, 2030));
  return $form_element;
}