I am using the Calendar module and have a view using standard Date arguments, but when I select those same arguments using Date Range instead of the normal Date argument type, Calendar complains that the view won't work without a Date type argument. It's apparently unaware of Date Range.

Comments

druplicate’s picture

This needs to be moved to the Calendar issue queue by the maintainer of Date Range. Just wanted to make people aware of it here first.

I believe this is the offending code from line 178 (line 627 might need fixing too) of calendar.module (dev version; timestamp = 1313712318):

<?php
function calendar_current_type($view) {
  if (!is_object($view) || !isset($view->argument) || !is_array($view->argument)) {
    if (!empty($view->date_info->default_display)) {
      return $view->date_info->default_display;
    }
    return FALSE;
  }
  $i = 0;
  $date_handler = new date_sql_handler();
  foreach ($view->argument as $argument) {
    if ($argument['id'] == 'date_argument') {
      $parts = array_keys($date_handler->arg_parts($view->args[$i]));
      break;
    }
    $i++;
  }
  return array_pop($parts);
}
?>

Just need to change to:

<?php
if ($argument['id'] == 'date_argument' ||  $argument['id'] == 'daterange_argument'){
?>