You are here

function _quiz_limit_year_options in Quiz 8.4

Same name and namespace in other branches
  1. 6.4 quiz.module \_quiz_limit_year_options()
  2. 7 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_options_form in ./quiz.pages.inc
Page callback for quiz options form

File

./quiz.module, line 924
Quiz Module

Code

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