I have a CCK node type called Event. It has a Date field named field_date. That has a to and from date, and granularity goes down to the minute.

I have a view named Upcoming_events. It has three filters:

  1. Only show published nodes.
  2. Only show Event nodes.
  3. Only show nodes whose date value >= now -1 day.
  4. What in fact displays is more like if rule #3 is value >= this year -1 day.

    Configuration of view filter:

  • Date form type: Select
  • Granularity: Day
  • Date year range: -3:+3
  • Operator: Is greater than or equal to
  • Date default: now -1 day

The view's export is attached.

CommentFileSizeAuthor
upcoming_events.txt2.98 KBaren cambre

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

If you only read one of these submission guidelines, read this one. (Then please read the rest) If your problem deals exclusively with fields or filters provided by another module (CCK, Image, VotingAPI are common) please post the issue under the queue for that module first; all modules are responsible for telling Views about their own fields. It's possible Views IS at fault, but the module maintainers are the best people to make that determination, and they can kick the issue into the Views queue with an explanation of what's wrong if that is the case.

Please file against the proper module.

aren cambre’s picture

Project: Views (for Drupal 7) » Date
Version: 6.x-2.3 » 6.x-2.0
Component: Views Data » Code
Status: Closed (won't fix) » Active

(fixing inadvertent wrong project assignment)

aren cambre’s picture

OK, date filter is definitely broken. Here's the SQL query:

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_date.field_date_value AS node_data_field_date_field_date_value
 FROM wrdnode node 
 LEFT JOIN wrdcontent_field_date node_data_field_date ON node.vid = node_data_field_date.vid
 WHERE ((node.type in ('event')) AND (node.status <> 0))
    AND (DATE_FORMAT(FROM_UNIXTIME(node_data_field_date.field_date_value), '%Y-%m-%d\T%H') >= '2009-01-01T00')
   ORDER BY node_data_field_date_field_date_value ASC

Note this part: >= '2009-01-01T00'.

trefethen’s picture

Aren is not alone. I also have run into this problem.

jez500’s picture

I am experiencing the same problem.
Also getting the Same date as Aren: 2009-01-01

kjy07’s picture

Ditto on this one. The absolute value is taking precedence over the relative value, even when no absolute value is specified (thus defaulting to the the first day of the first month of the current year).

aren cambre’s picture

Priority: Normal » Critical

Changing to critical because this is an essential feature of the product's Views integration.

aren cambre’s picture

Status: Active » Closed (duplicate)

Whoops, looks like this duplicates http://drupal.org/node/386406. Please subscribe to that one.