I'm using the Calendar Block module and have it displaying upcoming events nicely. Unfortunately though, the event only disappears when it's a month old despite setting the granularity to "Day". The query that's displayed in the preview shows:
"SELECT node.nid AS nid,
node.title AS node_title,
node_data_field_datetime.field_datetime_value AS node_data_field_datetime_field_datetime_value,
node_data_field_datetime.field_datetime_value2 AS node_data_field_datetime_field_datetime_value2,
node.type AS node_type,
node.vid AS node_vid
FROM drupal_node node
LEFT JOIN drupal_content_type_event node_data_field_datetime ON node.vid = node_data_field_datetime.vid
WHERE ((node.status <> 0) AND (node.type in ('event')))
AND ((DATE_FORMAT(node_data_field_datetime.field_datetime_value, '%Y-%m') <= '2009-12' AND DATE_FORMAT(node_data_field_datetime.field_datetime_value2, '%Y-%m') >= '2009-12'))
ORDER BY node_data_field_datetime_field_datetime_value ASC
"

It looks (to me) that the query is only using year and month, not day. This module looks quite a complicated beast so I'm reluctant to start delving into it's innards, especially as I'm still coming to grips with drupal itself. Can anyone else look at this? I have to say I'm a little concerned that the last update was getting on for a year ago and there are a number of issues outstanding on it. Is their another module that is better maintained which performs a similar function?

Comments

c4rl’s picture

Title: Day granularity doesn't work » Views integration -- date granularity
Category: bug » support

I don't see how this is a bug with Calendar Block. Changing category to support request.

I assume you are trying to integrate this module with the Views module to send arguments to a view. Is that indeed the case?

Indeed, the query you've written in your description doesn't appear correct if you are talking about day granularity and you're trying to send arguments via $op = 'alter' in hook_calendar_block().

How are you using this query? Are you copying it from the views preview and integrating it somehow with hook_calendar_block()?