date_api.module defines date_week_range($week, $year) but calendar.module uses date_week_range($year, $week).

Also $view->year is still used once in date_week_range(); should be $year.

Comments

karens’s picture

Status: Active » Fixed

Good catch! Thanks. This has been committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

thehong’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Priority: Critical » Major

Why it is #1:

  // move to the right week
  date_modify($min_date, '+' . strval(7 * ($week - 1)) . ' days');

But not #2:

  // move to the right week
  date_modify($min_date, '+' . strval(7 * $week) . ' days');

#1 get me 1 week off.

thehong’s picture

Status: Closed (fixed) » Active
arlinsandbulte’s picture

Status: Active » Fixed

@thehong:
I have a feeling your issue might be more closely related to this: #686394: Default of current time is off by one week for granularity of week

Setting this issue back to fixed.

thehong’s picture

Thanks arlinesandbulte, but how about my question on this issue?

arlinsandbulte’s picture

@thohong:
I'm really not sure exactly.
I think the root of all these 'week' issues (and there are a bunch of them) is due to the difference in ISO 8601's week number definition vs the customary US definition.
PHP uses ISO 8601 week numbers, so date has to do a bunch of trickery to deal with other week definitions (like the US convention).

With #641344: Add option to use ISO 8601 week numbers, I think all works pretty well if you use ISO 8601 week numbers.
But, other week number definitions don't work well right now.

Status: Fixed » Closed (fixed)

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