You are here

function date_api_form_system_regional_settings_alter in Date 7

Same name and namespace in other branches
  1. 8 date_api/date_api.module \date_api_form_system_regional_settings_alter()
  2. 7.3 date_api/date_api.module \date_api_form_system_regional_settings_alter()
  3. 7.2 date_api/date_api.module \date_api_form_system_regional_settings_alter()

Implementation of hook_form_alter().

Add a form element to configure whether or not week numbers are ISO-8601 (default: FALSE == US/UK/AUS norm).

File

date_api/date_api.module, line 1926
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_api_form_system_regional_settings_alter(&$form, $form_state, $form_id = 'system_date_time_settings') {
  $form['locale']['date_api_use_iso8601'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use ISO-8601 week numbers'),
    '#default_value' => variable_get('date_api_use_iso8601', FALSE),
    '#description' => t('IMPORTANT! If checked, First day of week MUST be set to Monday'),
  );
  $form['#validate'][] = 'date_api_form_system_settings_validate';
  $form = system_settings_form($form);
}