You are here

function date_timezone_process in Date 5.2

Same name and namespace in other branches
  1. 6.2 date_api_elements.inc \date_timezone_process()
  2. 6 date_api_elements.inc \date_timezone_process()

Create a timezone form element.

Parameters

array $element:

Return value

array the timezone form element

File

./date_api_elements.inc, line 89
Date API elements themes and validation. This file is only included during the edit process to reduce memory usage.

Code

function date_timezone_process($element, $edit = NULL) {
  $element['#tree'] = TRUE;
  $element['timezone'] = array(
    '#type' => 'select',
    '#title' => theme('date_part_label_timezone', 'select', $element),
    '#default_value' => $element['#value'],
    '#options' => date_timezone_names($element['#required']),
    '#weight' => $element['#weight'],
    '#required' => $element['#required'],
    '#theme' => 'date_select_element',
  );
  if (isset($element['#validate'])) {
    array_push($element['#validate'], array(
      'date_timezone_validate' => array(),
    ));
  }
  else {
    $element['#validate'] = array(
      'date_timezone_validate' => array(),
    );
  }
  return $element;
}