I have the module working, using the code below. The problem is, it picks up the time from what I assume is GMT, so events that occur after, say, 6 PM on April 15 will actually appear as if they occur on the following day. Any ideas? Thanks much!

function content_calendar_block(&$calendar, &$date, $op) {
  switch($op) {
    case 'alter':
    $sql = "SELECT content_type_event.field_datetime_value, content_type_event.nid FROM content_type_event;";
 $result = db_query( $sql );
 $dateDates = array();
 while ($node = db_fetch_object( $result))
 { 
 $dateDates[] = node_load ( array( 'nid' => $node->nid));
 }
  
 foreach ($dateDates as $var){
 $thisPath = $var->path;
 $thisDate = substr($var->field_datetime[0]['value'],0,10);
 $realDate = substr($thisDate, 5, 2) . "-" . substr($thisDate, 8,2)."-". substr($thisDate, 0, 4);
  
 if ($date->date == $realDate) {
 
 $date->content = l($date->day, "events/".$thisDate); 
 } 
 } 
 break;
  }
}

Comments

gudlaugsson’s picture

I am having a problem with this version of the module: Every month starts on the start of the week (i.e. it shows April 1 on a Su instead of a We). The "dev" version does not have this problem, but seems to be stuck on using Mo as the start of the week, despite "First day of week" being set to "Sunday". This is obviously a less severe of a problem. At least the calendar is correct.

Any thoughts on this? Could I be doing something wrong to cause this behavior?