1 date.elements.inc date_timezone_element_process($element, &$form_state, $form)

Creates a timezone form element.

Parameters

array $element: The timezone form element.

Return value

array: the timezone form element

File

core/modules/date/date.elements.inc, line 273
Date forms and form themes and validation.

Code

function date_timezone_element_process($element, &$form_state, $form) {
  if (date_hidden_element($element)) {
    return $element;
  }

  $element['#tree'] = TRUE;
  $element['timezone'] = array(
    '#type' => 'select',
    '#title' => t('Timezone'),
    '#title_display' => $element['#date_label_position'] == 'above' ? 'before' : 'invisible',
    '#options' => date_timezone_names($element['#required']),
    '#value' => $element['#value'],
    '#weight' => $element['#weight'],
    '#required' => $element['#required'],
    '#theme' => 'date_select_element',
    '#theme_wrappers' => array('form_element'),
  );
  if (isset($element['#element_validate'])) {
    array_push($element['#element_validate'], 'date_timezone_validate');
  }
  else {
    $element['#element_validate'] = array('date_timezone_validate');
  }

  $context = array(
    'form' => $form,
  );
  backdrop_alter('date_timezone_process', $element, $form_state, $context);

  return $element;
}