(First, if this is a views issue and not a date issue, please let me know and I will move it to views, I'm just following the instructions on the views submit request for help page.)

I'm trying to create a block of upcoming events, so I would think I need two filters, one for node type (generically called event) and one for the date (from today forward). Problem is, when I create a filter and set it to dates greater than or equal to now, no nodes are listed. Thinking I've got logic backwards, I try less than or equal to now, but now all nodes appear, both ones with a date before and after today.

What am I doing wrong?

Requested information:

The field type is date.
The type of widget is jscalendar.
The timezone is +0800 but is set to site throughout (though in this case, since the events are separated by several days, I don't think this is a timezone issue).
I'm not using the multiple option (but all entries have a to and from date/time).
I am using the required option.

If it helps, here's an export of my view:

$view = new view;
$view->name = 'upcoming_events';
$view->description = 'Upcoming Events';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = '0';
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'field_date_time_value' => array(
    'label' => '',
    'link_to_node' => 0,
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_date_time_value',
    'table' => 'node_data_field_date_time',
    'field' => 'field_date_time_value',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'field_date_time_value' => array(
    'order' => 'ASC',
    'id' => 'field_date_time_value',
    'table' => 'node_data_field_date_time',
    'field' => 'field_date_time_value',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'event' => 'event',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'date_filter' => array(
    'operator' => '>=',
    'value' => array(
      'valuedate' => 'now',
      'mindate' => '',
      'maxdate' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'date_field' => 'node_data_field_date_time.field_date_time_value',
    'granularity' => 'day',
    'adjustment_field' => '0',
    'id' => 'date_filter',
    'table' => 'node',
    'field' => 'date_filter',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('title', 'Upcoming Events');
$handler->override_option('style_plugin', 'list');
$handler = $view->new_display('block', 'Block', 'block_1');

Comments

Hannu’s picture

Hi,

I've got the exactly same behaviour with a similar case. (A view of upcoming events).

My setup is:

CCK 6.x-2.0-beta
Date 6.x-2.0-beta3
Views 6.x-2.0-beta4

The only difference is that instead of a jscalendar widget, I use a select list.

--
Hannu

karens’s picture

Status: Active » Fixed

First of all, move to the latest -dev version for Date (and Calendar, if you're using it). There have been changes to the filters since the beta. If there are still problems there, change the version and reopen.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.