First noticed on Calendar Month view, the Prev and Next pager links stay on the same month. The issue was in /sites/all/modules/date/date_views/includes/date_views_plugin_pager.inc Lines 283 and 285 in query() function where date_modify() uses $granularity variable which is not defined, so $this->options['granularity'] should be used instead.

Additionally date_modify() skips a full month due to this PHP issue: http://stackoverflow.com/questions/3602405/php-datetimemodify-adding-and...
So for a quick fix, as it is not critical for pager links on month view, the following works for me:

L283:date_modify($this->view->date_info->prev_date, '-1 ' . $this->options['granularity']);
L285:date_modify($this->view->date_info->next_date, '+1 ' . $this->options['granularity'] . ($this->options['granularity'] == 'month'?'-3 days':''));

If someone willing to review the validity of it and possibly pack it into a patch that'd be great, I'm not yet familiar with Drupal Issue queue.

Comments

math-hew’s picture

I was having the same issue. Tested your code and it worked fine for me. Thanks!

webengr’s picture

confirm, I had the same issue using the dev 7 dated 2015-Mar-06
the server had php 5.4.38

I modified lines 283 & 285 and that is working for the calendar tabs

jlea9378’s picture

Version: 7.x-2.9-beta2 » 7.x-2.9-rc1

I was having this same problem on 7.x-2.9-rc1 and this fix solved the problem for me.

andrew@oscailte.org’s picture

For version 7.x-2.9-rc1, the code (lines 283 - 285) looks like this:

date_modify($this->view->date_info->prev_date, '-1 ' . $argument->date_handler->granularity);
$this->view->date_info->next_date = clone($argument->max_date);
date_modify($this->view->date_info->next_date, '+1 ' . $argument->date_handler->granularity);

I changed just line 285 to be:

date_modify($this->view->date_info->next_date, '+1 ' . $argument->date_handler->granularity . ($argument->date_handler->granularity == 'month' ? '-3 days' : '') );
jody lynn’s picture

Lostboy22’s picture

See fix for -dev https://www.drupal.org/node/2375235
taging to -dev issue

andrew@oscailte.org’s picture

I still need the fix in my comment #4 above for version 7.x-2.9

SeanA’s picture

Status: Active » Closed (duplicate)