Not sure if this happens in any other instances but I have discovered a bug with the week link that is generated for a calendar view. For the January month view of 2012 the week link is being generated for 2012-W52.

What is happening

  1. Monday is set to be the first day of the week in regional settings
  2. January 1st of 2012 falls on a Sunday
  3. Week 52 of 2012 is being generated for the week link

What should be happening

  1. Week 52 of 2011 should generated for the week link

It looks like there is not a case setup to capture when a the first month of the year is being displayed and the first part of that month lies in December of the previous year. I was able to confirm this by changing my first day of the week to Sunday and the week link was being generate correctly.

After some quick code diving it appears that the links are generate in calendar_preprocess_date_views_page() on line 18 of calendar.module. I am going to see if I can write a quick patch for this.

Is anyone else experiencing this issue?

Comments

eigilb’s picture

I have the same issue here.
When entered into the "week" view, the "next" link points to "http://mysite.com/calendar/week/2012-W52?month=2012-W1" while the "previous" link points to "http://mysite.com/calendar/week/2012-W52?month=2012-W51".

In my opinion it would be better if the "week" link points to the current week when the calendar is showing the current month.

I also think that should apply to the "day" link. It seem a little far off that now on january 26. that the "day" link points to january 1.

In a calendar view for other than the current month the week/day links should point to the week/day closest to the current date for the month shown.

KarenS’s picture

Status: Active » Closed (cannot reproduce)

I am unable to replicate the original issue using the latest code of Date and Calendar. Make sure you have the latest dev version of both and run update.php. Also edit your view and make sure all the settings on the 'week' view are correct. I've tried all kinds of combinations and don't see that. I assume you are talking about the week link at the top of the calendar.

#1 is going off into different territory, there is already an issue about that at #1253482: Week / Day links on top of calendar go to first of the month, so we aren't going to address that here.

Dropper’s picture

Issue summary: View changes

Having the same issue for 2014. The second last week in december shows the correct date: week of december 22 in 2014. The "next" link already goes to december 28 in *2015* instead of 2014. This is probably the case because the last days of that week are already in the new year so the code supposes it has to change the year.

Dropper’s picture

Status: Closed (cannot reproduce) » Needs work
jastraat’s picture

I'm also seeing this issue.

In addition, since now it's the week of the 27th, the direct week view with the default argument value of 'current date' is showing 2015 instead of 2014.

mrkprod’s picture

same problem...!!!!

varenius’s picture

I also get this issue with Drupal 7.34, Calendar 7.x-3.5.

Summary
I have a Calendar view (at http://vale.oso.chalmers.se/salsa/reservation?week=2015-W02). When viewing the current week (in which January 1st 2015 falls on a Thursday), the forward and backwards links are correct, i.e. forward link goes to "2015-W02" backwards link goes to "2014-W52". When "clicking the forward link" I end up on a new page for "Week of Monday, January 5, 2015". While the content (the calendar) is correct, the backwards link goes to "2015-W53" instead of "2014-W53" or "2015-W01". Something is wrong in how the backwards link is generated.

cmo8’s picture

I am having the same issue with the Calendar. While in week month view (at https://www.uwplatt.edu/calendars/all-events/week/2015-W52). The next link will take you to https://www.uwplatt.edu/calendars/all-events/week/2016-W01. then when on https://www.uwplatt.edu/calendars/all-events/week/2016-W01 the prev link will take you to https://www.uwplatt.edu/calendars/all-events/week/2015-W52 and the next link will take you to https://www.uwplatt.edu/calendars/all-events/week/2016-W02. Then when on https://www.uwplatt.edu/calendars/all-events/week/2016-W02 the prev link will take you to https://www.uwplatt.edu/calendars/all-events/week/2015-W53.

The other issue along the same lines is in the month view when a in the month of January (https://www.uwplatt.edu/calendars/all-events/month/2016-01) the next will tack you to March.

Neslee Canil Pinto’s picture

Status: Needs work » Closed (outdated)