Index: calendar_api.inc =================================================================== --- calendar_api.inc (revision 8547) +++ calendar_api.inc (working copy) @@ -38,7 +38,7 @@ * @return Themed calendar view of nodes or array of calendar rows */ function calendar_get_calendar($view, $nodes, $module, $title = NULL, $params = array()) { - calendar_load_date_api(); + calendar_load_date_api(); $today = calendar_user_date(); if ($params['limit'][0]) { @@ -217,7 +217,7 @@ function calendar_get_calendar($view, $n $rows[] = calendar_week_header($params['mini'], $params['with_weekno']); while ($curstamp <= $lastday) { - for ($x = $start; $x < 7; $x++) { + for ($x = $start; $x < 7; $x++) { $cur_day = (($week * 7) + ($x + 1) - $offset); $selected = FALSE; if(is_array($days[$cur_day])) { @@ -342,6 +342,12 @@ function calendar_user_date($part = 'tim calendar_load_date_api(); if (!$date) { $now = date_time(); + if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) { + $now += $user->timezone; + } + else { + $now += variable_get('date_default_timezone', 0); + } $date = date_gmmktime(array( 'mon' => date_format_date('m', $now), 'mday' => date_format_date('j', $now), @@ -466,7 +472,7 @@ function calendar_week_header($mini = FA * @return integer day of the week */ function _calendar_day_of_week($stamp) { - calendar_load_date_api(); + calendar_load_date_api(); $dow = date_format_date('w', $stamp); if ($dow - variable_get('date_first_day', 1) >= 0 ) {