Index: includes/calendar.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/calendar/includes/calendar.inc,v retrieving revision 1.1.2.28 diff -u -p -r1.1.2.28 calendar.inc --- includes/calendar.inc 5 Dec 2008 09:12:15 -0000 1.1.2.28 +++ includes/calendar.inc 10 Feb 2009 15:03:32 -0000 @@ -357,6 +357,9 @@ function calendar_build_nodes(&$view, &$ // the correct timezone. $values[0] = $item->calendar_fields->$fromto[0]; $values[1] = $item->calendar_fields->$fromto[1]; + if (strpos($values[0], 'f') == (strlen($values[0]) - 1)) { + $item->calendar_fullday = TRUE; + } $db_tz = date_get_timezone_db($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name); $to_zone = date_get_timezone($tz_handling, isset($item->$tz_alias) ? $item->$tz_alias : $display_timezone_name); @@ -372,8 +375,9 @@ function calendar_build_nodes(&$view, &$ if ($db_tz != $to_zone) { date_timezone_set($date, timezone_open($to_zone)); } + $values[0] = date_format($date, DATE_FORMAT_DATETIME); - + if ($display_timezone_name != $to_zone) { date_timezone_set($date, $display_timezone); $values_display[0] = date_format($date, DATE_FORMAT_DATETIME); @@ -477,9 +481,14 @@ function calendar_build_nodes(&$view, &$ $end = date_format($next, DATE_FORMAT_DATETIME); // Get intersection of current day and the node value's duration (as strings in $to_zone timezone) - $node->calendar_start = $values[0] < $start ? $start : $values[0]; - $node->calendar_end = !empty($values[1]) ? ($values[1] > $end ? $end : $values[1]) : $node->calendar_start; - + if (strstr($view->current_display, '_ical')) { + $node->calendar_start = $values[0]; + $node->calendar_end = $values[1]; + } + else { + $node->calendar_start = $values[0] < $start ? $start : $values[0]; + $node->calendar_end = !empty($values[1]) ? ($values[1] > $end ? $end : $values[1]) : $node->calendar_start; + } // Make date objects $node->calendar_start_date = date_create($node->calendar_start, timezone_open($to_zone)); $node->calendar_end_date = date_create($node->calendar_end, timezone_open($to_zone)); @@ -493,6 +502,10 @@ function calendar_build_nodes(&$view, &$ // Change string timezones into // calendar_start and calendar_end are UTC dates as formatted strings + $only_date = !in_array('second', $field['granularity']) && !in_array('minute', $field['granularity']) && !in_array('hour', $field['granularity']) && strstr($view->current_display, '_ical'); + if ($only_date) { + $node->calendar_all_day = TRUE; + } $node->calendar_start = date_format($node->calendar_start_date, DATE_FORMAT_DATETIME); $node->calendar_end = date_format($node->calendar_end_date, DATE_FORMAT_DATETIME);