When navigating from one year to another, the navigation is somewhat bugged and doesn't always show the right week and dates.

Comments

Jochen Wendebaum’s picture

Status: Needs work » Closed (fixed)

fixed

ressa’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Closed (fixed) » Active

This still happens: If you click "previous week" from simplereservation/2/2010 -- you are taken to simplereservation/52/2009.

Also, the days are off by one: For example it says "Monday, 17.01.2010" when it really should be "Monday, 18.01.2010"

Jochen Wendebaum’s picture

I hoped that it was fixed... it worked here. Will be reviewed for 1.2

RoelG’s picture

Workaround:
Edit the simplereservation.modules and look for:

  $config["week"] = $week;

  $config["prev_week"] = $week - 1;
  $config["prev_week_year"] = $year;
  $config["prev_4week"] = $week - 4;
  $config["prev_4week_year"] = $year;
  if (date("z", $date) < 7)  { //if ($week == 1)
    $config["prev_week"] = 52;
    $config["prev_week_year"] = $year-1;
    $config["prev_4week"] = 48;
    $config["prev_4week_year"] = $year-1;

and change it to:

  $config["week"] = $week;

  $config["prev_week"] = $week - 1;
  $config["prev_week_year"] = $year;
  $config["prev_4week"] = $week - 4;
  $config["prev_4week_year"] = $year;
  if (date("z", $date) < 7)  { //if ($week == 1)
  $config["prev_week"] = $week - 1;
  $config["prev_week_year"] = $year;
  $config["prev_4week"] = $week - 4;
  $config["prev_4week_year"] = $year;

This will flawlessy get you a week or a month back in time. When you hit the year-switch (so week 1 jan 2010) and press back the module will not understand it, so this is still a bug.
For me this workaround solves this big problem but create another small one.

Let me know if this is sufficient to solve you problem.

jlmelvin’s picture

jlmelvin’s picture

if you instead change it to:

$config["week"] = $week;

$config["prev_week"] = $week - 1;
$config["prev_week_year"] = $year;
$config["prev_4week"] = $week - 4;
$config["prev_4week_year"] = $year;
if ($week <= 4) {
$config["prev_week"] = $week - 1;
$config["prev_week_year"] = $year;
$config["prev_4week"] = 52 - (4 - $week);
$config["prev_4week_year"] = $year - 1;
}
if ($week == 1) {
$config["prev_week"] = 52;
$config["prev_week_year"] = $year - 1;
}

the year change will work correctly

salvis’s picture

Assigned: Jochen Wendebaum » Unassigned
Status: Active » Fixed

Changed week view from date.module's "calendar weeks" to ISO weeks to fix this and other bugs.

Committed to the -dev version, give it up to 12h to be repackaged.

Status: Fixed » Closed (fixed)

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

  • Commit dc9667f on master, 8.x-1.x-dev, 8.x-1.x, 8.x-1.x-beta by salvis:
    #514750, #943078, #730294, #677784. Changed week view from date.module's...
  • Commit dc9667f on master, 8.x-1.x-dev, 8.x-1.x, 8.x-1.x-beta by salvis:
    #514750, #943078, #730294, #677784. Changed week view from date.module's...