Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-31824

Calendar "month" view - HTML classes are inconsistent

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.7, 2.4
    • Fix Version/s: 2.4
    • Component/s: Calendar
    • Labels:
    • Environment:
      MySQL, Windows Server 2003, PHP 5.3.8 (VC9), Apache 2.2.21.0 (VC9)
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Visit moodle/calendar/view.php?view=month.

      • Check the classes applied to days in the the current month and days in any other month.
      • On the current month all days have the class "nottoday" (except the actual current day)
      • The current day should have the class "today"
      • Apply a few of the main themes, and check the calendar to ensure it isn't broken.
      Show
      Visit moodle/calendar/view.php?view=month. Check the classes applied to days in the the current month and days in any other month. On the current month all days have the class "nottoday" (except the actual current day) The current day should have the class "today" Apply a few of the main themes, and check the calendar to ensure it isn't broken.
    • Workaround:
      Hide

      Patches

      Show
      Patches
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-31824-master

      Description

      When looking at calendar/view.php?view=month the HTML classes are inconsistent with other calendar views and are more generally speaking just broken:

      • Day cells are rendered as "today" or "nottoday" to signify blank cells. By comparison other calendar views use "day" or "dayblank" and then use "today" to highlight the actual date today.
      • When viewing a month other than the current month every day renders with a "nottoday" class.

      Main problem appear to be caused by an if statement in calendar/renderer.php at around line 520:

      // Special visual fx for today
      if($display->thismonth && $calendar->day == $calendar->day) {

      of course $calendar->day will ALWAYS equal itself so it returns every day of the current month as "today".

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    3/Dec/12