You are here

function date_api_form_system_regional_settings_alter in Date 8

Same name and namespace in other branches
  1. 7.3 date_api/date_api.module \date_api_form_system_regional_settings_alter()
  2. 7 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()

Implements hook_form_FORM_ID_alter() for system_regional_settings().

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

File

date_api/date_api.module, line 453
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) {
  $form['locale']['date_api_iso8601'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use ISO-8601 week numbers'),
    '#default_value' => config('date_api.settings')
      ->get('iso8601'),
    '#description' => t('IMPORTANT! If checked, First day of week MUST be set to Monday'),
  );
  $form['#validate'][] = 'date_api_form_system_settings_validate';
  $form['#submit'][] = 'date_api_form_system_settings_submit';
}