You are here

function date_api_form_system_settings_validate in Date 7

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

Validate that the option to use ISO weeks matches first day of week choice.

1 string reference to 'date_api_form_system_settings_validate'
date_api_form_system_regional_settings_alter in date_api/date_api.module
Implementation of hook_form_alter().

File

date_api/date_api.module, line 1940
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_settings_validate(&$form, &$form_state) {
  $form_values = $form_state['values'];
  if ($form_values['date_api_use_iso8601'] && $form_values['date_first_day'] != 1) {
    form_set_error('date_first_day', t('When using ISO-8601 week numbers, the first day of the week must be set to Monday.'));
  }
}