Moodle
  1. Moodle
  2. MDL-8402

calendar_weekend set to Sunday only affects Saturdays instead of Sundays

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Calendar
    • Labels:
      None
    • Environment:
      GNU/Linux, MySQL 5.0.27
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      Description

      When I only check Sunday from the 7 "Weekend Days" checkboxes (the calendar_weekend setting available at Appearance
      ? Calendar) and reload a page where the calendar block is enabled, all the Saturdays are shown in red (instead of all Sundays). The same vice-versa. I haven't yet looked into this issue deeper, first wanted to give a first report.

        Gliffy Diagrams

          Activity

          Hide
          Matt Clarkson added a comment -

          This bug is caused by the Calendar admin page storing the days in the reverse order to that used by the calendar block.

          So for example if the weekend day was set to Tuesday in the admin, then Thursday would be displayed on the calendar block.

          I have attached a patch that corrects the order in which the days are stored by the calendar admin. One the patch has been applied you will need to set the weekend days in the admin to the correct days.

          -Matt.

          Show
          Matt Clarkson added a comment - This bug is caused by the Calendar admin page storing the days in the reverse order to that used by the calendar block. So for example if the weekend day was set to Tuesday in the admin, then Thursday would be displayed on the calendar block. I have attached a patch that corrects the order in which the days are stored by the calendar admin. One the patch has been applied you will need to set the weekend days in the admin to the correct days. -Matt.
          Hide
          Robert Allerstorfer added a comment -

          Thank you Matt for providing the patch. I have applied it - and I can confirm it solves the problem. Thus, it should be commited into MOODLE_17_STABLE (and probably into other branches).

          best,
          rob.

          Show
          Robert Allerstorfer added a comment - Thank you Matt for providing the patch. I have applied it - and I can confirm it solves the problem. Thus, it should be commited into MOODLE_17_STABLE (and probably into other branches). best, rob.
          Hide
          Robert Allerstorfer added a comment -

          This bugfix has still not been commited to the current 1.7 or 1.8 branch

          Show
          Robert Allerstorfer added a comment - This bugfix has still not been commited to the current 1.7 or 1.8 branch
          Hide
          Jon Papaioannou added a comment -

          Fixed! I didn't use Matt's patch but made some more radical changes instead for maintainability.

          Thanks for the input and double thanks for taking the time to write and test a patch!

          Show
          Jon Papaioannou added a comment - Fixed! I didn't use Matt's patch but made some more radical changes instead for maintainability. Thanks for the input and double thanks for taking the time to write and test a patch!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: