Commit 3b5329d5 authored by Tobias Zimmermann's avatar Tobias Zimmermann
Browse files

Issue #1241996 by tstoeckler: Wrong time zone used on the clock configuration form.

parent c7061ce5
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line

Clock 7.x-1.x-dev
----------------------
- #1241996 by tstoeckler: Wrong time zone used on the clock configuration form.
- #1253596 by tstoeckler: Default values for clock configuration form broken.

Clock 7.x-1.1, 2011-02-08 
+7 −3
Changes for clock.module: 7 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ function clock_block_configure($delta = '') {
      // Each date format type has a corresponding variable. If it is not set,
      // get the list of date formats for that type and use the first one.
        $date_format = variable_get('date_format_' . $date_type, key(system_get_date_formats($date_type)));
        $date_types[$date_type] = $info['title'] . ' (' . date_format_date(date_now(_clock_get_timezone()), 'custom', $date_format) . ')';
        $date_types[$date_type] = $info['title'] . ' (' . date_format_date(date_now(_clock_get_timezone(TRUE)), 'custom', $date_format) . ')';
    }
    $form['date_type'] = array(
      '#type' => 'radios',
@@ -171,11 +171,15 @@ function clock_block_view($delta = '') {
/**
 * Gets the correct timezone to display.
 *
 * @param $date_format_date
 *   Whether or not the returned time zone is directly used in
 *   date_format_date(). Defaults to FALSE.
 *
 * @return
 *   The name of the timezone, NULL if the user's time zone is to be used or
 *   'Local' if the user's local time is to be used.
 */
function _clock_get_timezone() {
function _clock_get_timezone($date_format_date = FALSE) {
  $time_zone = variable_get('clock_time_zone', 2);
  switch ($time_zone) {
    // Site time zone.
@@ -188,7 +192,7 @@ function _clock_get_timezone() {
      break;
    // Local time zone.
    case 3:
      $time_zone = 'Local';
      $time_zone = ($date_format_date ? variable_get('date_default_timezone', 'UTC') : 'Local');
      break;
  }
  // If the time zone type is 'Custom time zone', $time_zone directly contains