You are here

function date_timezone_init in Date 6

Make sure a timezone has been selected.

File

date_timezone/date_timezone.module, line 14
This module will make the alter the user and site timezone forms to select a timezone name instead of a timezone offset.

Code

function date_timezone_init() {
  $tz_name = variable_get('date_default_timezone_name', NULL);
  if (!empty($user->uid) && $_GET['q'] != 'admin/settings/date-time' && empty($tz_name)) {
    drupal_set_message(t('The Date Timezone module requires you to !link.', array(
      '!link' => l(t('set the site timezone name'), 'admin/settings/date-time'),
    )), 'error');
  }
}