Commit 96845375 authored by Tobias Zimmermann's avatar Tobias Zimmermann
Browse files

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

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

Clock 6.x-1.x-dev
----------------------
- #1241996 by tstoeckler: Wrong time zone used on the clock configuration form.
- #1090892 by tstoeckler, PostHistory: Time zone not being applied correctly.

Clock 6.x-1.6, 2011-02-08
----------------------
+7 −3
Changes for clock.module: 7 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ function clock_block($op = 'list', $delta = 0, $edit = array()) {
      );

      // Format the current time with each of the three default date formats to display them in the form.
      $timezone = clock_get_timezone();
      $timezone = clock_get_timezone(TRUE);
      $short = date_format_date(date_now($timezone), $type = 'short');
      $medium = date_format_date(date_now($timezone), $type = 'medium');
      $long = date_format_date(date_now($timezone), $type = 'long');
@@ -200,12 +200,16 @@ function clock_theme() {
/**
 * Gets the correct time zone.
 *
 * @param $date_format_date
 *   Whether or not the returned time zone is directly used in
 *   date_format_date(). Defaults to FALSE.
 *
 * @return
 *   A string containing the time zone name or NULL if the time zone type is
 *   'User time zone'. If the time zone type is 'Local time zone' the string
 *   'Local' is returned.
 */
function clock_get_timezone() {
function clock_get_timezone($date_format_date = FALSE) {
  $timezone_type = variable_get('clock_timezone_type', '1');

  switch ($timezone_type) {
@@ -219,7 +223,7 @@ function clock_get_timezone() {
      break;
    // Local time zone.
    case '3':
      $timezone = 'Local';
      $timezone = ($date_format_date ? variable_get('date_default_timezone_name', 'UTC') : 'Local');
      break;
    // Custom time zone.
    case '4':